-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Attached EBS Volume tags flip flop between volume_tags for instance on each apply #164
Comments
To get them to flip-flop, run the terraform apply, then run a plan and you'll see it's trying to change the instance volume_tags and the tags on the volumes. Then you can run a second apply, followed by a plan, and you'll see it now wants to do the reverse. Output for flop 1 is:
Output for flop 2 is:
I don't specify my ebs volumes in with the instance resource, I have separate aws_ebs_volume resources and I attach them using aws_volume_attachment resources. I'm not specifying any value for volume_tags when calling the terraform-aws-ec2-instance module, because I want each attached volume to have its own set of tags (because the Name tag will be different for each one). The fields I use are:
You can see a few odd things:
I don't want to do a workaround of ignoring changes in the tags, because they may change in future. Ideally, if I don't specify any volume_tags, then I don't want it to add any, because I'm handling them separately. |
Hi, running into the same issue, even when no volume_tags are defined for the ec2 instance.. |
Same issue here |
Hi I ran into this today too. The below should fix this issue but I don't know if it would introduce any unwanted side-effects.
|
It seems the cleanest workaround is to define tags outside of the module for now.
|
This appears fixed in AWS 3.24.0+ with the addition of |
I don't use volume_tags, but after updating to 3.33.0 from 3.18.0 it showed in plan that volume_tags were nulled and partially deleted tags on my volumes as a result. it completely ignores tags on attached ebs_volumes (which wasn't the case before updating) |
Still issue, Any idea to solve this ? resource IMO, This module should remove https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#volume_tags |
I opened an issue since this problem has been bugging us as well. #216 |
This issue has been automatically marked as stale because it has been open 30 days |
This issue was automatically closed because of stale in 10 days |
I guess it's not worth taking the time to report terraform bugs. They are ignored then closed because they are "stale". |
@richard-browne perhaps we need to have regular weekly chats on the bugs we follow so that they do not get automatically closed, but that would also dilute the actual useful content in them 🤔 so there is an obvious bias for inaction here. |
Terraform shouldn't allow this to happen, it's more of a Terraform bug likely than a bug of this module. When you put tags on an external EBS volume, you need to also have the same tags and values in the volume_tags attribute on the parent ec2 resource (whether you're using this module, or not.) See also https://stackoverflow.com/questions/62470272/how-can-i-add-a-tag-to-aws-ebs-when-creating-through-ec2-with-terraform |
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. |
I came across this today,
It looks like this is a well-known issue, it is detailed here:
hashicorp/terraform-provider-aws#770
If I have EBS volumes with tags which are specified as attached to the instances then the tags get clobbered in a circular fashion.
There is a current workaround mentioned in the above thread but this for the moment means the correct tagging of EBS volumes attached to instances generated by this module is not possible as it will change alternately on each Apply.
The text was updated successfully, but these errors were encountered: