Skip to content
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

[0.12] Taint of resource with count can't taint all items #21509

Closed
domgoodwin opened this issue May 29, 2019 · 5 comments
Closed

[0.12] Taint of resource with count can't taint all items #21509

domgoodwin opened this issue May 29, 2019 · 5 comments
Labels
bug cli confirmed a Terraform Core team member has reproduced this issue v0.12 Issues (primarily bugs) reported against v0.12 releases

Comments

@domgoodwin
Copy link

Before in 0.11 I could taint a resource with a count without having to know how many resources there was. Now when I do it need to use the new module reference syntax with [0] on the end to reference a single resource and can't use splat to get all.

Terraform Version

Terraform v0.12.0

Terraform Configuration Files

resource "aws_ebs_volume" "volume" {
  count             = 3
  availability_zone = element(var.azs, count.index)
  size              = var.disk_volume_size
  type              = var.volume_type
  encrypted         = var.encrypt_volume
  kms_key_id        = var.kms_key_id
  snapshot_id       = var.data_disk_snapshot_id
}

Expected Behavior

As in terraform 0.11
terraform taint -module=my-volume aws_ebs_volume.volume
And all of my volumes with counts would be tainted

Actual Behavior

Now with the new calling syntax it doesn't allow me taint a group of resources with counts

terraform taint module.my-volume.aws_ebs_volume.volume

Gives me an error saying "No resource instance"

terraform taint module.my-volume.aws_ebs_volume.volume[0]

Works but only for the 1st volume

terraform taint module.my-volume.aws_ebs_volume.volume[*]

Gives me an error saying "Splat expressions ([*]) may not be used here."

@querry43
Copy link

I too depended on this functionality for tainting all of my replica databases when I rebuilt the master. It is nice if the engineer doing this doesn't have to know how many replicas we have. Everything else is just copy/paste.

@hashibot hashibot added the v0.12 Issues (primarily bugs) reported against v0.12 releases label Aug 22, 2019
@mercuriete
Copy link

it affects to me as well.

@StobyWan
Copy link

StobyWan commented May 9, 2020

it affects to me as well. I need to taint a for_each 's creations.

@pselle pselle added the confirmed a Terraform Core team member has reproduced this issue label Nov 10, 2020
@pselle
Copy link
Contributor

pselle commented Nov 10, 2020

This issue is absolutely still valid, however I am closing it to consolidate it as a duplicate of #1768. taint, in its current form, operates on one resource instance at a time, and asking taint to target multiple resource instances at once is an enhancement (and a greatly valued one at that!) from current behavior.

@pselle pselle closed this as completed Nov 10, 2020
@ghost
Copy link

ghost commented Dec 11, 2020

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.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug cli confirmed a Terraform Core team member has reproduced this issue v0.12 Issues (primarily bugs) reported against v0.12 releases
Projects
None yet
Development

No branches or pull requests

7 participants