Skip to content

Instantly share code, notes, and snippets.

@javatarz
Last active May 9, 2021 07:46
Show Gist options
  • Save javatarz/f78a72e02ce9aced0636d61672a2b777 to your computer and use it in GitHub Desktop.
Save javatarz/f78a72e02ce9aced0636d61672a2b777 to your computer and use it in GitHub Desktop.
Part of the functions.sh file
function fetch_secrets() {
workspace_name=$1
module_name=$2
secret_key_for_workspace=$(eval "echo \$SECRET_KEY_$workspace_name")
echo $(openssl enc -aes-256-cbc -d -in ../config/$workspace_name/$module_name.tfsecrets.enc -pass pass:$secret_key_for_workspace | sed '/^$/D' | sed 's/.*/TF_VAR_& /' | tr -d '\n')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment