Skip to content

Instantly share code, notes, and snippets.

@Blake-
Created June 17, 2021 14:14
Show Gist options
  • Save Blake-/0f2cc54bbdca5fb90cd5e44994d9085a to your computer and use it in GitHub Desktop.
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
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