-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
taint for resource with count > 1 affects all resources referring to it with element() #14357
Comments
This also happens for the resource "null_resource" "foo" {
count = "${var.use_floating_ip > 0 ? var.num-nodes : 0}"
triggers {
instance_id = "${element(openstack_compute_instance_v2.cmgeneric.*.id, count.index)}"
}
provisioner "local-exec" {
command = "echo \"hi\""
}
} and the
|
@mtougeron I think this is fixed by #14135 if you change your uses of If you're able, it'd be interesting to try your config on a build of current Terraform master and see if you still see the problem after replacing your use of the |
@apparentlymart yes! This works as I would expect it to. You rock as usual by fixing my bugs before I'm even able to report them. :)
|
@mtougeron I'm facing the same issue when using I'm having a variable structure similar to:
When ever I add another map to that variable, the Any workaround for this? |
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. |
When you have a secondary resource with a
count
> 1 that references another resource, with the samecount
, via theelement
function it treats all of the secondary resources as tainted if a single item in the primary resource is tainted.Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
terraform apply
output:Expected Behavior
Running
terraform taint
on only 1 of theopenstack_compute_instance_v2.cmgeneric
resources should only recreate the single taintedopenstack_compute_instance_v2
and the associatedopenstack_compute_floatingip_associate_v2
resource instead of all theopenstack_compute_floatingip_associate_v2
resources.Actual Behavior
It considers all
openstack_compute_floatingip_associate_v2
resources need to be recreated.Steps to Reproduce
First I taint an instance with
terraform taint openstack_compute_instance_v2.cmgeneric.2
Then when I run
terraform apply
it recreated all 3openstack_compute_floatingip_associate_v2
resources.The text was updated successfully, but these errors were encountered: