Created
January 19, 2016 18:48
-
-
Save justinclayton/01f349f66e908a243709 to your computer and use it in GitHub Desktop.
Terraform: taint all resources from one module
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
#!/bin/bash | |
module=$1 | |
for resource in `terraform show -module-depth=1 | grep module.${module} | tr -d ':' | sed -e 's/module.${module}.//'`; do | |
terraform taint -module ${module} ${resource} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rm -f terraform.tfstate*