CloudFormation stack paramater utility.
Project description
A CloudFormation stack parameter utility.
Installation
Install via pip:
pip install cfnparams which cfn-params
Motivation
cfn-params overcomes some limitations of the AWS CLI when handling stack paramaters, such as:
Simultaneously specifying both parameter arguments and parameter files, e.g. --parameters ParameterKey=foo,ParameterValue=bar --parameters file://params.json
Overly verbose JSON format
Features
Parameters can be:
specified on the CLI
specified in the AWS CLI JSON format
specified as Python dictionaries
resolved from the outputs of other stacks
Parameter Specification
Command Line
The same format as the AWS CLI is supported, however you must specify each parameter in its own argument e.g.:
--parameters ParameterKey=foo,ParameterValue=bar --parameters ParameterKey=baz,ParameterValue=quux
JSON files
The same format as the AWS CLI is supported, with the ability to specify as many input files as you like, e.g.:
--parameters file://path/to/params.json
Python dictionaries
Specified the same way JSON files are, but must have the extension .py:
--parameters file://path/to/params.py
e.g.:
{ # Values must be strings as required by CFN 'Key': 'Value', # All Python builtins are available: 'FortyTwo': str(6 * 7), 'MyCommaDelimitedList': ', '.join(['hello', 'world']), }
Output parameter resolution
When using the Python parameter format, a local method GetOutput(stack, output) is available for use, e.g.:
{ 'foo': GetOutput('other-stack', 'foo'), }
Stack lookup and resolution
If a dependent stack is referenced in a parameter, cfn-params will use the DescribeStacks API to resolve the parameter from the list of stack outputs.
The lookup process will:
Attempt to find a stack with the exact name specified
Optionally, use --resolve-tags to filter existing stack to find a fallback match.
The --resolve-tags argument is a list of tag key/value pairs to filter by.
e.g. if you want to only look for stacks in your staging environment:
--resolve-tags Key=Environment,Value=staging
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cfnparams-0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a925f30160a0b31fdf816ff627a8c20ab9abbe582d11e68330389507520523d0 |
|
MD5 | eb0b908efda925ae5636e962791b39f7 |
|
BLAKE2b-256 | 869623fd2eb69a2b7d9303f5665b286df33ad3b9ef9b13b4e3a33a35bb2a4135 |