Created
June 17, 2021 14:14
-
-
Save Blake-/0f2cc54bbdca5fb90cd5e44994d9085a to your computer and use it in GitHub Desktop.
Switch off disable_api_termination on a bunch of ec2s in a terraform file
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
A bunch of ec2s are created with disable_api_termination true which makes it really hard to kill them all when the time comes. | |
This just changes all the disable_api_termination vars from true to false so they can easily `terraform destroy` | |
``` | |
find . -type f -name "app[[:digit:]]*.tf" | xargs sed -i '' 's/disable_api_termination = true/disable_api_termination = false/g' | |
terraform apply | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment