Last active
November 8, 2018 17:19
-
-
Save Shogan/950b53d3b0b3133eb5e950f7702041fd to your computer and use it in GitHub Desktop.
aws-vault + terraform useful references
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
# 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