Skip to content

Instantly share code, notes, and snippets.

@kouk
Created April 22, 2019 15:11
Show Gist options
  • Save kouk/d10187bb9ca5710e7398fe63caeb813a to your computer and use it in GitHub Desktop.
Save kouk/d10187bb9ca5710e7398fe63caeb813a to your computer and use it in GitHub Desktop.
tfexec.sh
#!/bin/sh
NAME=$(basename $0)
PROFILE=${NAME#tf}
export TERRAGRUNT_DOWNLOAD=.terragrunt-cache-$PROFILE
exec env -u TF_DATA_DIR aws-vault exec $PROFILE -- "$@"
@kouk
Copy link
Author

kouk commented Apr 22, 2019

e.g. if you have a AWS profile called env-stage:

ln -s tfexec.sh tfenv-stage
tfenv-stage terraform apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment