Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
aws-vault + terraform useful references
# Using aws-vault with Terraform (to generate secure temporary session credentials in AWS for Terraform to use) can be tricky if you use a persistent session with aws-vault.
# These are the basic terraform workflow commands that work with aws-vault.
# The trick to using aws-vault and avoid session credential issues is to simply instruct aws-vault to not use a session with the --no-session flag.
# List / change TF workspace
aws-vault exec your_profile_name --no-session -- terraform workspace list
aws-vault exec your_profile_name --no-session -- terraform workspace select workspacenamehere
# Plan a change
aws-vault exec your_profile_name --no-session -- terraform plan -out="yourplan.tfplan"
# Apply a plan
aws-vault exec your_profile_name --no-session -- terraform apply "yourplan.tfplan"
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.