Skip to content

Commit

Permalink
where does it want these variables
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-jameson committed Jan 7, 2025
1 parent efc3670 commit c2e037f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions terraform/create_backend_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,41 @@ fi
echo "region = \"$(echo "${S3_CREDENTIALS}" | jq -r '.region')\""
echo "bucket = \"$(echo "${S3_CREDENTIALS}" | jq -r '.bucket')\""
} >> ./$1/backend_config.tfvars


set_backend_vars() {
var_list=(
"AMS_CLIENT_ID"
"AMS_CLIENT_SECRET"
"AMS_CONFIGURATION_ENDPOINT"
"BASE_URL"
"CLAMAV_NEEDED"
"CYPRESS_TOKEN"
"DJANGO_CONFIGURATION"
"DJANGO_DEBUG"
"DJANGO_SECRET_KEY"
"DJANGO_SETTINGS_MODULE"
"DJANGO_SU_NAME"
"FRONTEND_BASE_URL"
"KIBANA_BASE_URL"
"LOGGING_LEVEL"
"REDIS_URI"
"JWT_KEY"
"SENDGRID_API_KEY"
)

for var_name in ${var_list[@]}; do
var_value=${!var_name}

if [[ ("$CF_SPACE" = "tanf-staging") ]]; then
staging_var="STAGING_$var_name"
if [[ "${!staging_var}" ]]; then
var_value=${!staging_var}
fi
fi

echo "${var_name} = \"${var_value}\"" >> ./$1/backend_config.tfvars
done
}

set_backend_vars
2 changes: 1 addition & 1 deletion terraform/create_tf_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ set_backend_vars() {
done
}

set_backend_vars
#set_backend_vars

0 comments on commit c2e037f

Please sign in to comment.