Skip to content

Small script to parse YAML key/value pairs and generate the format expected by CloudFormation to pass input parameters to templates

License

Notifications You must be signed in to change notification settings

jlordiales/easy_cf_parameters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gem Version Build Status

CfParameters

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.

Installation

Add this line to your application's Gemfile:

gem 'cf_parameters'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cf_parameters

Usage

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"
  }
]

Contributing

  1. Fork it ( https://github.com/[my-github-username]/easy_cf_parameters/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Small script to parse YAML key/value pairs and generate the format expected by CloudFormation to pass input parameters to templates

Resources

License

Stars

Watchers

Forks

Packages

No packages published