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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_instance/volume_tags immedately out of date after creating new EC2 instance #21216
Comments
Hey @richard-browne 馃憢 Thank you for taking the time to file this. This feels like a bug to me, so I'm going to tag it as such so that the team can take a look into it as time permits. As a workaround, if you explicitly set |
Hi @justinretzolk yes is definitely a bug. No you can't add Next you will suggest use volume_tags instead of root_block_device/tags, and that would be ok for this example. But suppose you want different tags on root_block_device vs an additional ebs_block_device. |
Related: #20852. |
Thanks for the udpate @richard-browne; I'd not caught that those were mutually exclusive, but had considered that suggesting only using |
This bug has been open for over a year, is there any progress on it? This is impacting our ability to see what changes will be made during our Production terraform apply. If you have 200 deployed EC2 instances and are only updating something trivial like an EC2 security group, the terraform plan will show 201 resources to update. If we have more involved changes, we end up spending a long time verifying the plan is correct because of all the noise generated from this volume_tags bug. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Running
terraform apply
a second time immediately after the first time, we expect Terraform to find nothing to do.Actual Behavior
But when
terraform apply
is run for a second time, it claims the aws_instance is out of date and wants to change the aws_instance to set an empty volume_tags. See the following output:Steps to Reproduce
terraform apply
and observe the EC2 instance is created successfully with expected tags.terraform apply
again immediately and notice Terraform claims volume_tags are out of dateImportant Factoids
Although it seems unlikely, this problem occurs when user_data is given and user_data is in ignore_changes. Remove user_data, and the problem goes away.
I note in the first .tfstate file, we see this line:
and after the second apply, it is changed to:
Note that the .tf file does not have a volume_tags at all.
Adding volume_tags to ignore_changes does not fix the problem.
The text was updated successfully, but these errors were encountered: