向公众分发amazon machine images(amis)
distami的Python项目详细描述
通过将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-1和us-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凭据。
有关详细信息:
关于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除非适用的要求 法律或书面同意,根据许可证分发的软件是 按“原样”分配,无任何保证或条件 善意的,明示的或暗示的。具体见许可证 管理许可下的权限和限制的语言。