Created
August 26, 2019 13:42
-
-
Save javatarz/8e77d8ee1474a4d06faf9a4cc19ec0df to your computer and use it in GitHub Desktop.
apply.sh with config and secrets
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
#!/bin/bash | |
set -e | |
source $(dirname "$0")/functions.sh | |
cd $MODULE_NAME | |
echo "select or create new workspace $WORKSPACE_NAME" | |
terraform workspace select $WORKSPACE_NAME || terraform workspace new $WORKSPACE_NAME | |
echo "apply with var file config/$WORKSPACE_NAME/$MODULE_NAME.tfvars" | |
config=$(fetch_variables $WORKSPACE_NAME $MODULE_NAME) | |
secrets=$(fetch_secrets $WORKSPACE_NAME $MODULE_NAME) | |
eval "$secrets $config terraform apply -auto-approve" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment