Skip to content

Instantly share code, notes, and snippets.

@sdebruyn
Last active May 6, 2020 12:21
Show Gist options
  • Save sdebruyn/36d9b5b088b68c2e2673b8608ad5a4d3 to your computer and use it in GitHub Desktop.
Save sdebruyn/36d9b5b088b68c2e2673b8608ad5a4d3 to your computer and use it in GitHub Desktop.
taint all terraform resources
#!/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