跳转到主要内容

向公众分发亚马逊机器镜像(AMIs)

项目描述

Build Status

通过将其复制到一个、多个或所有AWS区域,并可选地将AMIs和快照公开或与特定AWS帐户共享,分发AMI。

用法

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的历史和细节。”在公开分发之前,请确保您的AMI安全: 公共AMI发布:加固和清理要求

示例

从Aminator等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

将us-east-1中的AMI与AWS帐户ID 123412341234 和 987698769876 共享。不要复制到其他区域,也不要公开。

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

源代码

DistAMI 的 Python 源代码可在 GitHub 上找到

https://github.com/Answers4AWS/distami

关于 Answers for AWS

此代码由 Peter Sankauskas 编写,他是 Answers for AWS 的创始人,一家专注于帮助企业充分利用 AWS 的公司。如果您需要 AWS 的帮助,请 联系我们

许可证

版权所有 2013 Answers for AWS LLC

根据 Apache 许可证 2.0 版(“许可证”);除非遵守许可证规定,否则您不得使用此文件。您可以在以下位置获取许可证副本:

https://apache.ac.cn/licenses/LICENSE-2.0 除非适用法律要求或书面同意,否则在许可证下分发的软件按“原样”基础分发,不提供任何形式的明示或暗示保证。有关许可证的特定语言,请参阅许可证。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源分发

distami-1.0.7.tar.gz (7.9 kB 查看哈希值)

上传时间

构建分发

distami-1.0.7.macosx-10.9-x86_64.tar.gz (12.3 kB 查看哈希值)

上传时间

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面