没有项目描述
OpsworksTool的Python项目详细描述
Opsworks工具
创建和部署opsworks堆栈到aws的工具。
当前版本-0.0.1:
- 从包含的模板创建新的Python2.7AWS Opsworks。
- 部署使用此工具创建的aws opsworks。它生成一个cloudformation文件并从该模板创建一个堆栈。
用法:
创建新的Opsworks堆栈:
Usage: opsworkstool new [OPTIONS]
Options:
-d, --directory TEXT target directory for new Opsworks recipe, defaults to
current directory
-n, --name TEXT name of the new opsworks skeleton [required]
-p, --profile TEXT AWS CLI profile to use in the deployment, more details
at http://docs.aws.amazon.com/cli/latest/userguide
/cli-chap-getting-started.html
-r, --region TEXT target region, defaults to your credentials default
region
--debug Turn on debugging
--help Show this message and exit.
Example:
opsworkstool -sn example --region us-east-2 # make a Flask webservice in example/main.py
创建新的Opsworks模板:
Usage: opsworkstool deploy [OPTIONS]
Options:
-d, --directory TEXT scratch directory for deploy, defaults to /tmp
-p, --profile TEXT AWS CLI profile to use in the deployment
-r, --region TEXT target region, defaults to your credentials default
region
--help Show this message and exit.
Example:
opsworkstool new --name test --profile will --directory /tmp/junk --region us-east-1
有关aws配置文件凭据的详细信息here。
刚刚发生了什么
- 这就创建了所需的文件
├── config
│ ├── config.ini
│ └── dev
│ └── function.properties
├── recipe
│ ├── Berksfile
│ └── test
│ ├── attributes
│ │ └── default.rb
│ ├── files
│ └── recipes
│ ├── default.rb
│ └── setup.rb
├── template.json
└── utility
├── __init__.py
└── tools.py
接下来的步骤
- 根据需要编辑template.json,并为所需阶段的参数编辑config/config.ini。注意:默认状态为dev
- 编辑recipe/test/recipe/setup.rb配方
部署Opswork模板
opsworkstool deploy --profile will -s dev
您需要什么:
- AWS帐户
- 该帐户中的vpc设置(或创建vpc的访问权限)。请参阅有关aws默认vpchere的更多信息。
- 该帐户中至少有一个子网(或创建一个子网的访问权限)
- 要分配给Opsworks实例的IAM角色。如果您没有合适的iam角色,您可以获得一些想法here。
- 一个非常简单的安全组
- 一个s3 bucket,您可以在其中放置构建/部署工件。此bucket必须与函数位于同一aws区域中。
- 一个最小的Python2.7开发环境,包括virtualenv或virtualenv包装器