Skip to content

Instantly share code, notes, and snippets.

@junaid18183
Forked from justinclayton/taint_module.sh
Created February 15, 2018 05:47
Show Gist options
  • Save junaid18183/0286a6008a1cb1713af30ea42d97f983 to your computer and use it in GitHub Desktop.
Save junaid18183/0286a6008a1cb1713af30ea42d97f983 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