Aws-cli: Support in parameter files in --parameter-overrides

Created on 12 Jul 2018  路  5Comments  路  Source: aws/aws-cli

As requested by @sanathkr over a year ago in https://github.com/awslabs/serverless-application-model/issues/111 I am submitted a request to support parameter files in the --parameter-overrides flag.

Sorry I never got any notifications for some reason...

cloudformation packagdeploy customization feature-request

Most helpful comment

This feature would be awesome, we are still hacking it using a file with key=value

All 5 comments

@digitalfiz, Thank you for following up. We are investigating this request and so far it appears to be a reasonable feature request and have changed the label as such. Thanks.

cc: @sanathkr

Don't know if this should be a separate feature request, but it would be great if --parameter-overrides supported YAML-formatted files.

This feature would be awesome, we are still hacking it using a file with key=value

It's Agree. Feature would be helpful.

This is how I solved this for now:

STACK=myStack
TEMPLATE=stack.yaml
PARAMETERS=config1.json

PROPERTIES=$(jq -r '.[] | "\(.ParameterKey)=\(.ParameterValue)"' ./$PARAMETERS)

aws cloudformation deploy \
--stack-name $STACK \
--template-file "./$TEMPLATE" \
--parameter-overrides $(echo $PROPERTIES)
  • Using jq to easy convert from json to key=value
  • Config file is json because that is what aws cloudformation create-change-set uses for example
  • Config looks like this:
[
  {
    "ParameterKey": "Environment",
    "ParameterValue": "dev"
  }
]
Was this page helpful?
0 / 5 - 0 ratings