-
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
aws_s3_bucket_object not working with more than 10 default tags #21273
Comments
There is a hard limit of 10 tags per S3 Object: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html. |
that's correct. should this resource type take the first 10 tags from the provider's |
@erikpaasonen: If this is the most simple solution it could already be a good start, as it would allow using this resource when more than 10 default tags are configured. Right now we are defining the same provider twice, one with default tags, one without... as we are using this resource in some modules to which we have the pass the additional provider this makes it really cumbersome to manage. Afaik the order for |
Would it be better to have a way to choose which default tags to choose or ignore? I've come across this issue because I was looking for issues related to this Terraform provider validating how many tags are passed to AWS. Even without >10 default tags it is cumbersome to have Because of this I would suggest perhaps a |
Relates: #19895. |
@ollytheninja : I would already be fine with a ignore_default_tags = ["foo", "bar"]
ignore_default_tags = ["foo*"]
ignore_default_tags = ["*"] As we often group tags via prefixes allowing wildcards would allow to ignore whole groups of prefixes :) |
@chris922 I think if the filter approach is used then the parameter needs to be I guess there are multiple possible solutions here, one or more of which could be applied:
I've never contributed to Terraform, I'll see if I can find the time in the next few weeks to dive in and understand what would be required to implement this. |
has there been any movement on this? We just got bit by this, and I'd like a way to just have this ignore the default_tags coming in and just take the tags passed into it. |
I missed this issue, so from #24692, I'd like to mention two possible options:
|
We've also run into this issue where I work. Because of our tagging policy, which lists more than 10 required tags. The workaround we've used is to supply a secondary Provider that has no default tags, but is otherwise identical to the existing one. For those coming to this thread looking for a solution, my starting point was the Terraform documentation on Provider configurations. Of course, a better solution would be preferred in the long run. |
This issue is still very much relevant. |
It's important to mention this is not mentioned in the Terraform documentation either, so it's upon the user to either read the exact AWS documentation or to (more likely) stumble across the error themselves. |
The above MR, #33262, would remove the default tags (good) but we need AWS to increase the S3 tagging limit for TF to have this fixed. |
@jamespfluger-ava while I zagerer this is on AWS to fix properly, given S3 object tagging was introduced in 2016, three months after other tags were increased from 10 to 50. I for one won't be holding my breath on AWS fixing it anytime soon. |
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'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
Description
When you define more than 10 default tags in your AWS provider it is not possible to use the
aws_s3_bucket_object
resource, because AWS doesn't allow more than 10 tags for S3 objects.I guess this problem should be solved on a higher level, e.g. introduce a possibility to exclude certain or all default tags for any resource or exclude on AWS provider level certain resources for default tags.
Workaround: Creating an additional AWS provider with an alias that do not have any default-tags. :(
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Error: Error putting object in S3 bucket (foo): BadRequest: Object tags cannot be greater than 10
Panic Output
Expected Behavior
It is possible to create the s3_object
Actual Behavior
It is not possible to create the s3_object
Steps to Reproduce
terraform init && terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: