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

provider: Support default tags (resources aws_r*) #18726

Merged
merged 2 commits into from
Apr 21, 2021
Merged

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Apr 9, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Reference: #7926

Output from acceptance testing: Will be handled via CI, review, and daily acceptance testing

@bflad bflad requested a review from a team as a code owner April 9, 2021 20:20
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Apr 9, 2021
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. service/ram Issues and PRs that pertain to the ram service. service/rds Issues and PRs that pertain to the rds service. service/redshift Issues and PRs that pertain to the redshift service. service/resourcegroups Issues and PRs that pertain to the resourcegroups service. service/route53 Issues and PRs that pertain to the route53 service. service/route53resolver Issues and PRs that pertain to the route53resolver service. labels Apr 9, 2021
@bflad bflad requested a review from ewbankkit as a code owner April 12, 2021 13:55
@ghost ghost added the documentation Introduces or discusses updates to documentation. label Apr 12, 2021
bflad added a commit that referenced this pull request Apr 20, 2021
…add unit testing, and fix potential panic

Reference: #18726 (comment)

The current behavior is to return an empty `KeyValueTags` if the type is unrecognized in `New()` in preference over panicking or requiring all consumers to implement error handling. This augments `New()` to accept the named `KeyValueTags` in addition to its underlying `map[string]*TagData` type, preventing confusing behavior on an otherwise easy to miss resource/service implementation detail.

Added unit testing to cover various `New()` type scenarios. Fixed panic discovered while implementing the unit testing.
bflad added a commit that referenced this pull request Apr 20, 2021
…add unit testing, and fix potential panic (#19011)

* internal/keyvaluetags: Allow KeyValueTags type passthrough in New(), add unit testing, and fix potential panic

Reference: #18726 (comment)

The current behavior is to return an empty `KeyValueTags` if the type is unrecognized in `New()` in preference over panicking or requiring all consumers to implement error handling. This augments `New()` to accept the named `KeyValueTags` in addition to its underlying `map[string]*TagData` type, preventing confusing behavior on an otherwise easy to miss resource/service implementation detail.

Added unit testing to cover various `New()` type scenarios. Fixed panic discovered while implementing the unit testing.

* internal/keyvaluetags: Ensure New() of KeyValueTags named and underlying types are copies
@bflad bflad merged commit 1962b97 into main Apr 21, 2021
@bflad bflad deleted the f-default-tags-r branch April 21, 2021 17:00
@github-actions github-actions bot added this to the v3.38.0 milestone Apr 21, 2021
@ghost
Copy link

ghost commented Apr 30, 2021

This has been released in version 3.38.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 for triage. Thanks!

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, 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 May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. service/ram Issues and PRs that pertain to the ram service. service/rds Issues and PRs that pertain to the rds service. service/redshift Issues and PRs that pertain to the redshift service. service/resourcegroups Issues and PRs that pertain to the resourcegroups service. service/route53resolver Issues and PRs that pertain to the route53resolver service. service/route53 Issues and PRs that pertain to the route53 service. size/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants