Skip to content

Commit

Permalink
Update docstring and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Illia Batozskyi committed Aug 7, 2020
1 parent d95d284 commit 889219a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/feature-cloudformation-43713.json
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "``cloudformation``",
"description": "CloudFormation ``deploy`` command now supports various JSON file formats as an input for ``--parameter-overrides`` option."
}
4 changes: 2 additions & 2 deletions awscli/customizations/cloudformation/deploy.py
Expand Up @@ -113,13 +113,13 @@ class DeployCommand(BasicCommand):
'nargs': '+',
'default': [],
'help_text': (
'A list of parameter structures that specify input parameters'
' A list of parameter structures that specify input parameters'
' for your stack template. If you\'re updating a stack and you'
' don\'t specify a parameter, the command uses the stack\'s'
' existing value. For new stacks, you must specify'
' parameters that don\'t have a default value.'
' Syntax: ParameterKey1=ParameterValue1'
' ParameterKey2=ParameterValue2 ...'
' ParameterKey2=ParameterValue2 ... or JSON file (see Examples)'
)
},
{
Expand Down
37 changes: 37 additions & 0 deletions awscli/examples/cloudformation/deploy.rst
Expand Up @@ -4,3 +4,40 @@ Following command deploys template named ``template.json`` to a stack named

aws cloudformation deploy --template-file /path_to_template/template.json --stack-name my-new-stack --parameter-overrides Key1=Value1 Key2=Value2 --tags Key1=Value1 Key2=Value2

or the same command using parameters from JSON file ``parameters.json``::

aws cloudformation deploy --template-file /path_to_template/template.json --stack-name my-new-stack --parameter-overrides file://path_to_parameters/parameters.json --tags Key1=Value1 Key2=Value2

Supported JSON syntax
~~~~~~~~~~~~~~~~~~~~~

Original format::

[
"Key1=Value1",
"Key2=Value2"
]

CloudFormation like format::

[
{
"ParameterKey": "Key1",
"ParameterValue": "Value1",
},
{
"ParameterKey": "Key2",
"ParameterValue": "Value2",
},
]

Note: Only ParameterKey and ParameterValue are expected keys, command will through an exception if receives unexpected keys (e.g. UsePreviousValue or ResolvedValue).

CodePipeline like format::

[
"Parameters": {
"Key1": "Value1",
"Key2": "Value2"
}
]

0 comments on commit 889219a

Please sign in to comment.