-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
ignore_changes not working for sets #22504
Comments
Hi @ryzr, Sorry you're experiencing an issue with this configuration. This does however appear to be working as intended. A "set" data structure is unordered, and therefore has no way of consistently addressing individual elements of the set. One possibility here is that we might be able to extend the syntax to allow addressing an attribute of all set elements, e.g. The only way to allow addressing of individual |
Hi, Having the same issue with autoscaling group when i'm trying to ignore a specific Tag :
I'm using Terraform v0.12.6 |
I'm experiencing the same issue with ignoring snapshot_id in ebs_block_device sets. When we launch an instance from an ami created with Packer that has multiple block devices terraform wants to rebuild the instance after subsequent runs because of the presence of the snapshot id.
|
So any solutions for this issue ? |
Would it be possible to introduce a way of manually indexing set members? provider "aws" {}
resource "aws_s3_bucket" "foo" {
bucket = "bar"
logging {
index = 0
target_bucket = "baz"
target_prefix = "log/"
}
lifecycle {
ignore_changes = [logging[0].target_bucket]
}
} I'm unfamiliar with the internals of Terraform, but if this is doable, I could probably take a stab at it. |
Also running into this issue when using kubernetes resources that can be dynamically updated by operators (e.g. a namespace where the operators add their own annotations to a namespace). |
Related to this issue: Some resources such as It appears that
The workaround is to use numeric list indexing like this:
This breaks anytime the ordering of |
. It's not working for me, i'm receiving this error :
And here is my tag variable :
|
@jbardin is this a bug in the documention at https://www.terraform.io/docs/configuration/resources.html#ignore_changes or a bug in terraform? The tags applied here make it seem like you think this is a bug in the documentation but I have the same behavior as other reporters regarding changes to parts of a |
@janxious, this issue is not in reference to a bug in terraform or the documentation. Individual set elements are not addressable, and therefore cannot be referenced in |
for maps it would also be nice if the key could be supplied as a prefix or wildcard .. ie |
Ran into this issue when attempting to ignore the the aws_ecs_service load_balancer target_group_arn, which is updated dynamically via CodeDeploy during containerized Blue/Green deployments. |
There might be something more actionable happen if you open an issue in https://github.com/terraform-providers/terraform-provider-aws repo (or search for a relevant issue); you could potentially suggest @jbardin 's idea of using a TypeList rather than a Set. I'm not actively developing with Terraform at the moment, so I'll leave that to someone else. |
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. |
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/ryzr/46c4dbd7f085efa76bb4aad96194b502
Expected Behavior
The
target_bucket
key of the first logging set should be ignored.Actual Behavior
The following error output is produced:
Steps to Reproduce
terraform init
terraform apply
Additional Context
I've scoured the internet for any other possible variations I could use, and failed (all produce the same error):
References
The text was updated successfully, but these errors were encountered: