Skip to content

Instantly share code, notes, and snippets.

@Shogan
Last active November 8, 2018 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shogan/950b53d3b0b3133eb5e950f7702041fd to your computer and use it in GitHub Desktop.
Save Shogan/950b53d3b0b3133eb5e950f7702041fd to your computer and use it in GitHub Desktop.
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