Created
August 26, 2019 13:43
-
-
Save javatarz/3efb6a5d416d4149678b427bc37ff154 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 "plan 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 plan -out=$MODULE_NAME.tfplan -input=false" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment