向公众分发amazon machine images(amis)

distami的Python项目详细描述


Build Status

通过将ami复制到一个、多个或所有aws区域来分发ami,还可以选择将ami和快照公开或与特定aws帐户共享。

用法

usage: distami [-h] [--region REGION] [--to REGIONS] [--non-public]
               [--accounts AWS_ACCOUNT_IDs] [-p] [-v] [--version]
               AMI_ID

Distributes an AMI by copying it to one, many, or all AWS regions, and by
optionally making the AMIs and Snapshots public.

positional arguments:
  AMI_ID                the source AMI ID to distribute. E.g. ami-1234abcd

optional arguments:
  -h, --help            show this help message and exit
  --region REGION       the region the AMI is in (default is current region of
                        EC2 instance this is running on). E.g. us-east-1
  --to REGIONS          comma-separated list of regions to copy the AMI to.
                        The default is all regions. Specify "none" to prevent
                        copying to other regions. E.g. us-east-1,us-west-1,us-
                        west-2
  --non-public          Copies the AMIs to other regions, but does not make
                        the AMIs or snapshots public. Bad karma, but good for
                        AMIs that need to be private/internal only
  --accounts AWS_ACCOUNT_IDs
                        comma-separated list of AWS Account IDs to share an
                        AMI with. Assumes --non-public. Specify --to=none to
                        share without copying.
  -p, --parallel        Perform each copy to another region in parallel. The
                        default is in serial which can take a long time
  -v, --verbose         enable verbose output (-vvv for more)
  --version             display version number and exit

安全性

“作为公共ami的发布者,您负责机器映像的初始安全状态 当一个ami公开时,它可以由不安全的客户启动 专家,以及不熟悉ami的历史和细节的人。 在公开发行之前:Public AMI Publishing: Hardening and Clean-up Requirements

示例

从ec2实例将ami并行复制到所有区域,如 胺化剂:

distami -p ami-abcd1234

us-east-1中将ami复制到us-west-1

distami --region us-east-1 ami-abcd1234 --to us-west-1

eu-west-1中的ami复制到us-west-1us-west-2,但不要将ami或其副本公开

distami --region eu-west-1 ami-abcd1234 --to us-west-1,us-west-2 --non-public

使用aws帐户id 123412341234和987698769876在us-east-1中共享ami。不要复制到其他地区,也不要公开。

distami --region=us-east-1 ami-abcd1234 --to=none --accounts=123412341234,987698769876

安装

您可以使用通常的pypi通道安装distami。示例:

sudo pip install distami

您可以在这里找到包的详细信息:https://pypi.python.org/pypi/distami

或者,如果您希望从源安装:

git clone git@github.com:Answers4AWS/distami.git
cd distami
python setup.py install

配置

distami使用boto进行api调用,这意味着您可以使用iam角色并从ec2实例运行distami,或者使用环境变量或.boto文件来传递您的aws凭据。

有关详细信息:

http://boto.readthedocs.org/en/latest/boto_config_tut.html

源代码

github上提供了distami的python源代码:

https://github.com/Answers4AWS/distami

关于AWS的答案

这段代码是由Peter Sankauskas编写的,他是Answers for AWS-一家专注于 帮助企业充分利用aws。如果你在寻求帮助 使用aws,请contact us

许可证

AWS LLC版权所有2013 answers

根据apache许可证2.0版(以下简称“许可证”)授权;您可以 除非符合许可证,否则不要使用此文件。你可以获得 在

http://www.apache.org/licenses/LICENSE-2.0除非适用的要求 法律或书面同意,根据许可证分发的软件是 按“原样”分配,无任何保证或条件 善意的,明示的或暗示的。具体见许可证 管理许可下的权限和限制的语言。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java:字符串。RTL设备语言用标志“+”格式化,数字后加符号   java GAE作为桌面应用程序(Swing)的服务提供商   java将InputStream转换为FileInputStream不适用于Apache POI   java外部Voronoi库“网格”:什么是草图和处理?   重载重写的泛型方法java   java显示组织上设置的错误。springframework。验证。jsp中的错误对象   java一些Spring模型属性没有显示在我的JSP中   java无法编译Guava 23的SimpleTimeLimiter示例   java如何更改JTree中的“根”目录名?   java如何在安卓中对相对布局产生连锁反应?   java错误:org。冬眠例外SQLGrammarException:无法提取结果集,dateAccessed是未知列   如何使用java监听JSON文件更新   由抽象封闭类创建的匿名内部类能否通过反射确定实现类?