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]: Empty Tag in Provider's default_tags Clears Previous Tags #34155

Open
sam-axcient opened this issue Oct 29, 2023 · 2 comments
Open

[Bug]: Empty Tag in Provider's default_tags Clears Previous Tags #34155

sam-axcient opened this issue Oct 29, 2023 · 2 comments
Labels
bug Addresses a defect in current functionality. service/logs Issues and PRs that pertain to the logs service. tags Pertains to resource tagging.

Comments

@sam-axcient
Copy link

Terraform Core Version

1.6.0

AWS Provider Version

5.23.1, 5.23.0

Affected Resource(s)

aws_cloudwatch_log_group

Expected Behavior

Adding an empty tag to the provider's default_tags should be added to all resources

Actual Behavior

Adding an empty tag to the provider's default_tags currently clears all previous tags on resources, and new tags do not update after applying.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

provider "aws" {
  default_tags {
    tags = {
      Service        = "myservice"
      # Owner          = ""
    }
  }
}

resource "aws_cloudwatch_log_group" "api_gw" {
  name              = "/aws/api_gw/some-gateway"
}

output "api_gw_tags_all" {
  value = aws_cloudwatch_log_group.api_gw.tags_all
}

Steps to Reproduce

  1. Run terraform apply to set up resources with tags.
  2. Now, run terraform apply again with an uncommented empty tag in the default_tags configuration.

Debug Output

first.log
Outputs

api_gw_tags_all = tomap({
  "Service" = "myservice"
})

second.log
Outputs:

api_gw_tags_all = tomap({})

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

@sam-axcient sam-axcient added the bug Addresses a defect in current functionality. label Oct 29, 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/logs Issues and PRs that pertain to the logs service. label Oct 29, 2023
@sam-axcient sam-axcient changed the title [Bug]: [Bug]: Empty Tag in Provider's default_tags Clears Previous Tags Oct 29, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 29, 2023
@johnsonaj
Copy link
Contributor

Relates to #31941

@johnsonaj johnsonaj added tags Pertains to resource tagging. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/logs Issues and PRs that pertain to the logs service. tags Pertains to resource tagging.
Projects
None yet
Development

No branches or pull requests

2 participants