Skip to content
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

[Bug]: aws_s3_bucket resource incosistent with provider.aws.default_tags #32618

Closed
floppy-engineer opened this issue Jul 20, 2023 · 4 comments
Closed
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@floppy-engineer
Copy link

Terraform Core Version

1.5.1

AWS Provider Version

5.8.0

Affected Resource(s)

Using together provider.aws.default_tags and resource aws_s3_bucket with additional tag give incorrect behavior.

Expected Behavior

Combine tags: from default_tags + from the resource

Actual Behavior

  1. When there is no s3 bucket - terraform creates the bucket as expected with all tags
  2. When the bucket is already exist and have all tags - terraform removes all tags
  3. When the bucket exist and have no tags - terraform adds all expected tags.

So, continuous applying the same resource without any changes cause the cycle - 2. -> 3. -> 2. -> 3...

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}

provider "aws" {
region = "us-east-1"
default_tags {
tags = { aaa = "aaa" }
}
}

resource "aws_s3_bucket" "bucket" {
bucket = "bucket1"
tags = { bbb = "bbb" }
}

Steps to Reproduce

Just applying the same source code over and over

Debug Output

No response

Panic Output

No response

Important Factoids

We use terraform from docker container: registry.gitlab.com/gitlab-org/terraform-images/stable:latest

References

No response

Would you like to implement a fix?

None

@floppy-engineer floppy-engineer added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jul 20, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/s3 Issues and PRs that pertain to the s3 service. label Jul 20, 2023
@maunzCache
Copy link

Duplicates #31941

@floppy-engineer
Copy link
Author

Agree. The behavior is just because of empty tag. Thank you very much, @maunzCache!
And I close the issue as it's a duplicate. Sorry.

@floppy-engineer floppy-engineer closed this as not planned Won't fix, can't repro, duplicate, stale Jul 20, 2023
@github-actions github-actions bot removed the needs-triage Waiting for first response or review from a maintainer. label Jul 20, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

2 participants