Skip to content

Instantly share code, notes, and snippets.

@actionjack
Forked from justinclayton/taint_module.sh
Created November 18, 2020 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save actionjack/ab0647cd9b7adf6da8879a62bc200b82 to your computer and use it in GitHub Desktop.
Save actionjack/ab0647cd9b7adf6da8879a62bc200b82 to your computer and use it in GitHub Desktop.
Terraform: taint all resources from one module
#!/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