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

Tags: Add custom Map type with semantic equality for tags and tags_all attributes #38869

Merged
merged 55 commits into from
Sep 4, 2024

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Aug 14, 2024

Description

Adds a custom Map type with semantic equality for tags and tags_all attributes. This prevents perpetual diffs when using null-valued tags.

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ec2 Issues and PRs that pertain to the ec2 service. service/guardduty Issues and PRs that pertain to the guardduty service. service/rds Issues and PRs that pertain to the rds service. service/medialive Issues and PRs that pertain to the medialive service. service/elasticache Issues and PRs that pertain to the elasticache service. service/workspaces Issues and PRs that pertain to the workspaces service. service/batch Issues and PRs that pertain to the batch service. provider Pertains to the provider itself, rather than any interaction with AWS. service/fms Issues and PRs that pertain to the fms service. service/eks Issues and PRs that pertain to the eks service. service/s3control Issues and PRs that pertain to the s3control service. service/transfer Issues and PRs that pertain to the transfer service. service/securityhub Issues and PRs that pertain to the securityhub service. service/globalaccelerator Issues and PRs that pertain to the globalaccelerator service. service/quicksight Issues and PRs that pertain to the quicksight service. service/appconfig Issues and PRs that pertain to the appconfig service. service/codeguruprofiler Issues and PRs that pertain to the codeguruprofiler service. service/ssoadmin Issues and PRs that pertain to the ssoadmin service. linter Pertains to changes to or issues with the various linters. service/networkfirewall Issues and PRs that pertain to the networkfirewall service. service/auditmanager Issues and PRs that pertain to the auditmanager service. tags Pertains to resource tagging. generators Relates to code generators. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) service/amp Issues and PRs that pertain to the amp service. skaff Issues and pull requested related to the skaff tool service/drs Issues and PRs that pertain to the drs service. service/rekognition Issues and PRs that pertain to the rekognition service. labels Aug 14, 2024
@gdavison gdavison force-pushed the td-framwork-tags-custom-type branch from 7ce4d6d to e41dedb Compare August 30, 2024 01:49
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/pinpoint Issues and PRs that pertain to the pinpoint service. repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. labels Aug 30, 2024
@gdavison gdavison marked this pull request as ready for review August 30, 2024 17:12
@gdavison gdavison requested a review from a team as a code owner August 30, 2024 17:12
@gdavison gdavison changed the title [WIP] Tag testing: Add custom Map type with semantic equality for tags and tags_all attributes Tags: Add custom Map type with semantic equality for tags and tags_all attributes Aug 30, 2024
}

func (t mapType) String() string {
return "fooMapType"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not foo 😄.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

@ewbankkit
Copy link
Contributor

Do we need a CHANGELOG entry?

@ewbankkit ewbankkit self-assigned this Sep 4, 2024
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccVPCSecurityGroupIngressRule_' PKG=ec2 ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccVPCSecurityGroupIngressRule_ -timeout 360m
=== RUN   TestAccVPCSecurityGroupIngressRule_tags
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_null
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_null
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_AddOnUpdate
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_AddOnUpdate
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnCreate
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnCreate
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Add
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Add
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Replace
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Replace
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_providerOnly
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_providerOnly
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nonOverlapping
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_overlapping
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_overlapping
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToProviderOnly
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToProviderOnly
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToResourceOnly
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToResourceOnly
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyResourceTag
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyResourceTag
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyProviderOnlyTag
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyProviderOnlyTag
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullOverlappingResourceTag
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullOverlappingResourceTag
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullNonOverlappingResourceTag
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullNonOverlappingResourceTag
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnCreate
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnCreate
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Add
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Add
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Replace
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Replace
=== RUN   TestAccVPCSecurityGroupIngressRule_basic
=== PAUSE TestAccVPCSecurityGroupIngressRule_basic
=== RUN   TestAccVPCSecurityGroupIngressRule_disappears
=== PAUSE TestAccVPCSecurityGroupIngressRule_disappears
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_defaultAndIgnoreTags
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_defaultAndIgnoreTags
=== RUN   TestAccVPCSecurityGroupIngressRule_tags_ignoreTags
=== PAUSE TestAccVPCSecurityGroupIngressRule_tags_ignoreTags
=== RUN   TestAccVPCSecurityGroupIngressRule_cidrIPv4
=== PAUSE TestAccVPCSecurityGroupIngressRule_cidrIPv4
=== RUN   TestAccVPCSecurityGroupIngressRule_cidrIPv6
=== PAUSE TestAccVPCSecurityGroupIngressRule_cidrIPv6
=== RUN   TestAccVPCSecurityGroupIngressRule_description
=== PAUSE TestAccVPCSecurityGroupIngressRule_description
=== RUN   TestAccVPCSecurityGroupIngressRule_prefixListID
=== PAUSE TestAccVPCSecurityGroupIngressRule_prefixListID
=== RUN   TestAccVPCSecurityGroupIngressRule_referencedSecurityGroupID
=== PAUSE TestAccVPCSecurityGroupIngressRule_referencedSecurityGroupID
=== RUN   TestAccVPCSecurityGroupIngressRule_ReferencedSecurityGroupID_peerVPC
=== PAUSE TestAccVPCSecurityGroupIngressRule_ReferencedSecurityGroupID_peerVPC
=== RUN   TestAccVPCSecurityGroupIngressRule_updateSourceType
=== PAUSE TestAccVPCSecurityGroupIngressRule_updateSourceType
=== CONT  TestAccVPCSecurityGroupIngressRule_tags
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnCreate
=== CONT  TestAccVPCSecurityGroupIngressRule_cidrIPv4
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnCreate (23.10s)
=== CONT  TestAccVPCSecurityGroupIngressRule_disappears
--- PASS: TestAccVPCSecurityGroupIngressRule_cidrIPv4 (28.03s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_ignoreTags
--- PASS: TestAccVPCSecurityGroupIngressRule_disappears (16.85s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_defaultAndIgnoreTags
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_ignoreTags (24.96s)
=== CONT  TestAccVPCSecurityGroupIngressRule_referencedSecurityGroupID
=== CONT  TestAccVPCSecurityGroupIngressRule_updateSourceType
--- PASS: TestAccVPCSecurityGroupIngressRule_tags (55.99s)
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_defaultAndIgnoreTags (24.85s)
=== CONT  TestAccVPCSecurityGroupIngressRule_ReferencedSecurityGroupID_peerVPC
    vpc_security_group_ingress_rule_test.go:476: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccVPCSecurityGroupIngressRule_ReferencedSecurityGroupID_peerVPC (0.00s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_overlapping
--- PASS: TestAccVPCSecurityGroupIngressRule_referencedSecurityGroupID (29.37s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullNonOverlappingResourceTag
--- PASS: TestAccVPCSecurityGroupIngressRule_updateSourceType (27.55s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullOverlappingResourceTag
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullNonOverlappingResourceTag (19.05s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nullOverlappingResourceTag (19.10s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_overlapping (49.04s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyProviderOnlyTag (19.45s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToProviderOnly
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_emptyResourceTag (19.58s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToResourceOnly (30.82s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nonOverlapping
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_updateToProviderOnly (30.12s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_providerOnly
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Add (41.33s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_nonOverlapping (46.53s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnUpdate_Replace (28.49s)
=== CONT  TestAccVPCSecurityGroupIngressRule_basic
--- PASS: TestAccVPCSecurityGroupIngressRule_basic (18.16s)
=== CONT  TestAccVPCSecurityGroupIngressRule_description
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_DefaultTags_providerOnly (61.00s)
=== CONT  TestAccVPCSecurityGroupIngressRule_prefixListID
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Replace (32.84s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Add
--- PASS: TestAccVPCSecurityGroupIngressRule_description (27.29s)
=== CONT  TestAccVPCSecurityGroupIngressRule_cidrIPv6
--- PASS: TestAccVPCSecurityGroupIngressRule_prefixListID (37.38s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_AddOnUpdate
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_ComputedTag_OnUpdate_Add (33.05s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnCreate
--- PASS: TestAccVPCSecurityGroupIngressRule_cidrIPv6 (27.96s)
=== CONT  TestAccVPCSecurityGroupIngressRule_tags_null
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_AddOnUpdate (29.51s)
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_null (18.63s)
--- PASS: TestAccVPCSecurityGroupIngressRule_tags_EmptyTag_OnCreate (31.43s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	293.774s

@gdavison gdavison merged commit 9c62f68 into main Sep 4, 2024
40 checks passed
@gdavison gdavison deleted the td-framwork-tags-custom-type branch September 4, 2024 19:49
@github-actions github-actions bot added this to the v5.66.0 milestone Sep 4, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

This functionality has been released in v5.66.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!

Copy link

github-actions bot commented Oct 7, 2024

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 Oct 7, 2024
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. generators Relates to code generators. linter Pertains to changes to or issues with the various linters. provider Pertains to the provider itself, rather than any interaction with AWS. repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. service/amp Issues and PRs that pertain to the amp service. service/appconfig Issues and PRs that pertain to the appconfig service. service/appfabric Issues and PRs that pertain to the appfabric service. service/auditmanager Issues and PRs that pertain to the auditmanager service. service/batch Issues and PRs that pertain to the batch service. service/bcmdataexports Issues and PRs that pertain to the bcmdataexports service. service/bedrock Issues and PRs that pertain to the bedrock service. service/bedrockagent Issues and PRs that pertain to the bedrockagent service. service/chatbot Issues and PRs that pertain to the chatbot service. service/codeguruprofiler Issues and PRs that pertain to the codeguruprofiler service. service/datazone Issues and PRs that pertain to the datazone service. service/docdbelastic Issues and PRs that pertain to the docdbelastic service. service/drs Issues and PRs that pertain to the drs service. service/ec2 Issues and PRs that pertain to the ec2 service. service/eks Issues and PRs that pertain to the eks service. service/elasticache Issues and PRs that pertain to the elasticache service. service/fms Issues and PRs that pertain to the fms service. service/globalaccelerator Issues and PRs that pertain to the globalaccelerator service. service/guardduty Issues and PRs that pertain to the guardduty service. service/lexv2models Issues and PRs that pertain to the lexv2models service. service/m2 Issues and PRs that pertain to the m2 service. service/medialive Issues and PRs that pertain to the medialive service. service/meta Issues and PRs that pertain to the meta service. service/networkfirewall Issues and PRs that pertain to the networkfirewall service. service/networkmonitor Issues and PRs that pertain to the networkmonitor service. service/opensearchserverless Issues and PRs that pertain to the opensearchserverless service. service/osis Issues and PRs that pertain to the osis service. service/paymentcryptography Issues and PRs that pertain to the paymentcryptography service. service/pinpoint Issues and PRs that pertain to the pinpoint service. service/quicksight Issues and PRs that pertain to the quicksight service. service/rds Issues and PRs that pertain to the rds service. service/rekognition Issues and PRs that pertain to the rekognition service. service/resourceexplorer2 Issues and PRs that pertain to the resourceexplorer2 service. service/s3control Issues and PRs that pertain to the s3control service. service/securityhub Issues and PRs that pertain to the securityhub service. service/securitylake Issues and PRs that pertain to the securitylake service. service/ssmcontacts Issues and PRs that pertain to the ssmcontacts service. service/ssoadmin Issues and PRs that pertain to the ssoadmin service. service/timestreaminfluxdb Issues and PRs that pertain to the timestreaminfluxdb service. service/transfer Issues and PRs that pertain to the transfer service. service/vpc Issues and PRs that pertain to the vpc service. service/workspaces Issues and PRs that pertain to the workspaces service. skaff Issues and pull requested related to the skaff tool tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants