Created
June 22, 2017 13:52
-
-
Save lgallard/6f394791c76dadf990b5403b46d453c6 to your computer and use it in GitHub Desktop.
A script to run Terraform using the hashicorp/terraform image container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment