-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Idempotency issue when using Provider tags #2214
Comments
this is a well known issue with the use of |
Yes. Unfortunately I don't expect a solution in the provider anytime soon. I need to duplicate the provider tags on cluster_tags to get the tag on the security group that EKS creates. However, since the tag lists are merged, it then gets added on the EKS resource as well, which causes the issue. There are two solutions above that will fix this, with different impact on users of this module. |
thank you @gjkamstra for the detailed write up. I have been able to take some time to test and validate the details you have provided and I think we can most definitely support the 2nd option you have listed. This should be available starting in v18.30.0 once released in #2249 |
This issue has been resolved in version 18.30.0 🎉 |
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. |
Description
I am using provider tags as described in http://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block. These tags don't get applied to the security groups, since they get created by EKS and not Terraform. Therefore I replicate these tags on the cluster_tags variable of the module. I do that by retrieving them from the provider settings using the aws_default_tags datasource.
However when i do that,
terraform apply
keeps telling me that it needs to update the tags. This is due to thecluster_tags
getting merged withtags
and then set on theeks
resource.Versions
Module version [Required]:
18.28.0
Terraform version:
Terraform v1.2.7
on darwin_amd64
Provider version(s):
Reproduction Code [Required]
Example: master...gjkamstra:terraform-aws-eks:provider-tag-example
Steps to reproduce the behavior:
Execute
terraform apply
and say yes.Execute it again, Terraform will say that there are still updates required to the tags. It will keep doing that
Expected behavior
No changes required, after we just did
terraform apply
Actual behavior
Tag changes need to be applied
Terminal Output Screenshot(s)
Expanded plan:
Additional context
Issue comes from specifying the same tag on the provider as on the tags property (done since module merges cluster tags with tags and sets that to tags on the EKS resource. Documentation of the provider shows that you should not do this.
I have created two possible fixes.
Keep behavior as is, but remove provider tags from tags property.
You will still need to duplicate the provider tags on the cluster_tags variable to set the tag on the security group
master...gjkamstra:terraform-aws-eks:strip-provider-tags-from-tags
Automatically add the provider tags to the security groups
This way you no longer have to duplicate the provider tags on the cluster_tag variable. The module will retrieve them and set them by itself. I prefer this approach
master...gjkamstra:terraform-aws-eks:add-provider-tags-to-security-group
Please let me know which solution you prefer. I will then raise the pull request. Or if you have a different solution, that is fine too.
The text was updated successfully, but these errors were encountered: