-
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
Overwrite tags to an EBS attached to an EC2 instance when volume_tags is specified #5878
Comments
Just hit same thing. |
Seems to be a different behaviour than before. With version <= v1.40.0 that wasn't the case for me and behaved as expected (root EBS gets the tags from |
Here is my observations, in the hope it could help to write a patch. Please note that I don't know much of terraform internals, and not much about go, so it's unfortunate that I cannot provide a patch and a test case.
In From theses observations I believe it would be enough to fix the problem with attached volumes. How about volumes declared in instance resource? From what I understand, any change here would trigger a resource recreation. EDIT
|
Same here. +1 to upvote this. |
This is a problem for us, and is affecting DLM snapshot lifecycle as the disk we want backed up are not visible due to sporadic tag-changes. |
Idem +1 |
+1 for the issue an obvious workaround:
|
I might agree with that if it applied, but yes. We did use that workaround in the past too just to get around the terraform state difference every time. |
Same as of v2.14.0. Don't see anything in v.2.15.0 that addresses this. +1 to upvote. |
The issue was addressed in #12226 |
We have merged a fix to the Now that the fix is in place, if you find any problems with |
This has been released in version 3.24.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 for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @notuscloud as hashicorp/terraform#18860. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
I use
https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/blob/v1.9.0/main.tf
which rely on thevolume_tags
directive.Debug Output
Expected Behavior
The tag
volume_tags.Selector
belongs to an EBS provisioned by terraform beforehand, by an another team with its own separate set of files. The volume is then attached to an EC2 instance thanks to anaws_volume_attachment
.When applying modifications to the instance, it should not update the tags of the attached EBS, only the tags of the volumes created directly by the
aws_instance
resource.Actual Behavior
Terraform changes the tags of every attached disk, even those not created when you spawned the instance.
Steps to Reproduce
volume_tags
directive.terraform apply
The text was updated successfully, but these errors were encountered: