Terraform: does taint support TF modules?

Created on 25 Apr 2015  ·  3Comments  ·  Source: hashicorp/terraform

I have in a main.tf, an instance of a module:

module "cleaders" {
    source = "../leaders"
    ...
}

And I want to _taint_ that module, so I run tf taint:

ᐅ tf taint module.cleaders
The module root has no resources. There is nothing to taint.

I see talk of which resource to target in a module in taint's docs https://terraform.io/docs/commands/taint.html, but I am unable to figure out how to taint a module (from root) so that the entire module is rm'd on the next apply.

Most helpful comment

You can taint resources within modules:

terraform taint -module=cleaders resource.designator

Ie. I often use terraform taint -module=salt_master aws_instance.salt_master to reprovision my configuration management servers.

Granted, this is different from tainting the entire module; I'm not sure how to go about that except for tainting all resources.

All 3 comments

You can taint resources within modules:

terraform taint -module=cleaders resource.designator

Ie. I often use terraform taint -module=salt_master aws_instance.salt_master to reprovision my configuration management servers.

Granted, this is different from tainting the entire module; I'm not sure how to go about that except for tainting all resources.

thanks @arubis! I have used your confirmation to update the docs a tiny bit.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rjinski picture rjinski  ·  3Comments

jeroenjacobs79 picture jeroenjacobs79  ·  3Comments

carl-youngblood picture carl-youngblood  ·  3Comments

shanmugakarna picture shanmugakarna  ·  3Comments

franklinwise picture franklinwise  ·  3Comments