Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Switch env for TF v0.9.0 and higher (composite env w/region)
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
You can’t perform that action at this time.