[Bug]: Adding Tags to S3 Buckets Causes Perpetual Drift #34185
Labels
bug
Addresses a defect in current functionality.
service/s3
Issues and PRs that pertain to the s3 service.
tags
Pertains to resource tagging.
Milestone
Terraform Core Version
Terraform v1.6.2 on windows_amd64
AWS Provider Version
registry.terraform.io/hashicorp/aws v5.23.1
Affected Resource(s)
S3 buckets
Expected Behavior
Tags attached to a S3 bucket are created as defined in the variables or an error should be returned that the tags aren't formatted correctly.
Actual Behavior
2 scenarios
I added tags to the resource with one tag being an empty string and it deleted all tags on the resource. This scenario causes perpetual drift and an immediate plan after deploying, shows changes need to be applied.
I added tags to the resource with all tags not being empty strings and the tags applied properly.
This behavior does not occur on another resource I am deploying with the same Terraform which is a VPC.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Minimal Configuration
https://gist.github.com/tomburge/65280e05d2bfd308f78c4b5704dfe826
Steps to Reproduce
Create a new project.
Create the files from the above gist.
Ensure that version 1.6.2 and AWS provider version 5.23.1 are used.
Plan and deploy with first version of tags. Plan again.
Plan and deploy with second version of tags. Plan again.
Screenshot 1 shows no tags:
Screenshot 2 shows tags with an empty tag created from the console:
Screenshot 3 shows the same tags on a VPC.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: