Last active
April 15, 2017 16:48
-
-
Save vancluever/47fa75a53cb063db09f9a42cfbf96252 to your computer and use it in GitHub Desktop.
Switch env for TF v0.9.0 and higher (composite env w/region)
This file contains 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
if ! env_list="$(terraform env list)"; then | |
exit 1 | |
fi | |
if [[ "${env_list}" == *"${ENV}_${REGION}"* ]]; then | |
terraform env select "${ENV}_${REGION}" | |
else | |
terraform env new "${ENV}_${REGION}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment