-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Apply with more than 10 default_tags fails due to aws_s3_bucket_objects limit #19895
Comments
Also, documentation only specifies differences for Auto Scaling Groups, while the one for S3 objects is also very important and should be at least mentioned. I ended up using separate provider just for |
It would also be helpful, if you could override the
|
Create separate provider for s3objects
|
That would be great as https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider documentation clearly states: Setting default tags at the provider level will not supersede tags set on individual resources as resource tags take precedence. |
Still present in provider version 5.x. It has specific options to disable all sorts of tagging on an object, however, if you use default_tags (or tags_all) the apply will fail with this module. |
Any update on this? It has been a real PITA with our Terrafrom |
Please upvote the fix provided on #33262 |
Thank you @walteh and @ewbankkit for your work resolving this issue 🙏 |
This functionality has been released in v5.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. Thank you! |
I have |
This is what the implementation ended up looking like:
|
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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v1.0.0
provider 3.46.0
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
The error below is acceptable.
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
The problem is that s3 objects have a hard limit on tags:
"You can associate up to 10 tags with an object. Tags that are associated with an object must have unique tag keys. "
https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html
At the same time there doesn't seem to be a way of opting out of default tags:
"Provider tags can be overridden with new values, but not excluded from specific resources."
https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags
This means that in practice you can max have 10 default tags if you use s3 object resources. I understand this might sound like a silly use case, but when your company requires a large amount of mandatory tags this becauses a problem.
It would be great if we could for example opt of default tags for bucket objects AND/OR catch this on terraform plan.
Thanks for all your great work with Terraform!
The text was updated successfully, but these errors were encountered: