CloudFormation JSON files to specify input parameters are cumbersome to write. They also don't provide any easy way to specify values from environment variables. This small script allows you to specify key/value pairs in YAML format with the added capability of resolving those values from environment variables if the value starts with $. You can write the output to a file and pass that to CloudFormation together with your template.
Add this line to your application's Gemfile:
gem 'cf_parameters'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cf_parameters
cat some.yml
key1: value1
key2: $SOME_ENV_VAR
export SOME_ENV_VAR=5
cf_parameters some.yml
[
{
"ParameterKey": "key1",
"ParameterValue": "value1"
},
{
"ParameterKey": "key2",
"ParameterValue": "5"
}
]
- Fork it ( https://github.com/[my-github-username]/easy_cf_parameters/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request