Skip to content

Generate Terraform map variable from environment variables.

Notifications You must be signed in to change notification settings

shanesavoie/tfmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

tfmap

Command line tool to convert environment variables into a Terraform map variable.

Example: MAP_foo=bar MAP_abc=123 = {foo:bar, abc:123}

Installation

Locally

go get -u github.com/shanesavoie/tfmap

Usage

  • --help - Will list the available options.
  • --whitelist=MAP_ - Will only take in environment variables with the specefied prefix.
  • --export=TF_VAR_my_map - Will export to the specified environment variable.

Example

$ MAP_foo=bar MAP_abc=123 tfmap --whitelist=MAP_ --export=TF_VAR_ecs_environment
export TF_VAR_ecs_environment='{"abc":"123","foo":"bar"}'

Apply to Terraform

eval "$(tfmap)"
terraform ... 

About

Generate Terraform map variable from environment variables.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages