-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Bug]: Existing tags being reapplied to resources when there are no changes. #36448
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I believe this is specific to We are heavy users of Terraform version 1.2.9 |
I wonder if this behavior stems from #33769, which finally fixes the issue of Just for background, we set a number of default tags in our provider. In order to get them onto the root block device, we have to do something like this:
I wonder if the fact that the tags are present both in the |
Hello, we have the same issue - every time we run "terraform plan" or "terraform apply" Terraform wants to change tags:
To be more specific about our use case: Prior to AWS Terraform provider version 5.39.0 everything was OK. For example with 5.38.0, 5.37.0, 5.36.0 etc -> when we created EC2 via our custom module -> EC2 was created with "default_tags" and EBS Volume was created with all required tags. Logic to assign "volume_tags" that we use is next:
Important note: we use "volume_tags" and we do NOT touch "root_block_device" section in any way (regarding tags):
We assign "default_tags" like this:
Terraform version:
After release of AWS Terraform provider version 5.39.0 (and up to latest one, which is 5.42.0 at this moment) - every time we run "terraform plan" and "terraform apply" Terraform wants to update in-place "volume_tags" (despite the fact that "volume_tags" already in good state. Please advice - is there any way to get this fixed? |
I confirm the behavior with I searched in the code and found these lines: terraform-provider-aws/internal/service/ec2/ec2_instance.go Lines 1299 to 1301 in 7e31a73
I'm unsure about the logic expressed here so I can't produce a fix for now, this seems to force the default_tags to always be missing from the in memory representation of the instance before evaluation of the changes, hence the perpetual change when compared to the actual desired tags for the block. |
We have perpetual change on volume_tags too. We also use default_tags. This only started happening recently, maybe in the last month or two. |
This is really really painful when you implemented default tags for all of your infrastructure. Every pipeline run requires review and approval. |
I opened PR #37441 for this. We encountered this problem and this patch fixes it for us. We've been running a local build of the provider because the false drift was unbearable. It's a pretty simple patch, but it needs a maintainer to look at it of course. |
@0xkag Our savior. Thank you. |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
1 similar comment
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.72.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Terraform Core Version
1.5.7
AWS Provider Version
5.41.0
Affected Resource(s)
aws_ec2_instance
and its sub-resourceroot_block_device
.Expected Behavior
No plan should be generated, since there are no changes to apply.
Actual Behavior
Terraform generates a plan that wants to add tags that already exist to resources.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Create an
aws_instance
resource with tags applied to theroot_block_device
. Run multiple times.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: