Last active
May 6, 2020 12:21
-
-
Save sdebruyn/36d9b5b088b68c2e2673b8608ad5a4d3 to your computer and use it in GitHub Desktop.
taint all terraform resources
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 | |
set -e | |
for resource in `terraform show | grep "# " | grep -v "tainted" | grep -v "data\." | tr -d ":" | tr -d "# "`; do | |
echo "Tainting ${resource}" | |
terraform taint $resource | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment