A script to run Terraform using the hashicorp/terraform image container
tfdocker AWS_PROFILE WORK_DIR VERSION "COMMAND PARAM"
Examples:
Running terraform 0.9.8 with command and params:
#/bin/sh | |
`grep -A 2 "\[$1\]" $HOME/.aws/credentials | tail -n 2 | awk '{ print toupper($1)"="$3 }' | sed '/^AWS_/s/^/export /'` | |
docker run -it -v $PWD:/data -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY --workdir=/data/$2 hashicorp/terraform:$3 $4 |
I hereby claim:
To claim this, I am signing this object: