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

autoflex: Adds support for Expanding union types #38192

Merged
merged 23 commits into from
Jul 8, 2024

Conversation

gdavison
Copy link
Contributor

Description

Adds the fwflex.Expander interface to allow model types to specify how they expand. Used for "tagged union types" implemented in the AWS SDK as an interface type.

Implemented in

  • aws_m2_application
  • aws_m2_environment
  • aws_bedrockagent_agent_action_group

@gdavison gdavison requested a review from a team as a code owner June 28, 2024 23:58
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 size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/fsx Issues and PRs that pertain to the fsx service. service/bedrock Issues and PRs that pertain to the bedrock service. service/m2 Issues and PRs that pertain to the m2 service. service/bedrockagent Issues and PRs that pertain to the bedrockagent service. labels Jun 28, 2024
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jun 28, 2024
@gdavison gdavison force-pushed the td-autoflex-union-types-expand branch from b60471b to e81e36d Compare June 29, 2024 00:15
@gdavison gdavison force-pushed the td-autoflex-union-types-expand branch from b977bcc to 933b37c Compare July 5, 2024 23:59
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=TestAccM2Environment_\|TestAccM2Application_' PKG=m2 ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/m2/... -v -count 1 -parallel 3  -run=TestAccM2Environment_\|TestAccM2Application_ -timeout 360m
=== RUN   TestAccM2Application_tags
=== PAUSE TestAccM2Application_tags
=== RUN   TestAccM2Application_tags_null
    application_tags_gen_test.go:192: Tags with null values are not correctly handled with the Plugin Framework
--- SKIP: TestAccM2Application_tags_null (0.00s)
=== RUN   TestAccM2Application_tags_AddOnUpdate
=== PAUSE TestAccM2Application_tags_AddOnUpdate
=== RUN   TestAccM2Application_tags_EmptyTag_OnCreate
=== PAUSE TestAccM2Application_tags_EmptyTag_OnCreate
=== RUN   TestAccM2Application_tags_EmptyTag_OnUpdate_Add
=== PAUSE TestAccM2Application_tags_EmptyTag_OnUpdate_Add
=== RUN   TestAccM2Application_tags_EmptyTag_OnUpdate_Replace
=== PAUSE TestAccM2Application_tags_EmptyTag_OnUpdate_Replace
=== RUN   TestAccM2Application_tags_DefaultTags_providerOnly
=== PAUSE TestAccM2Application_tags_DefaultTags_providerOnly
=== RUN   TestAccM2Application_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccM2Application_tags_DefaultTags_nonOverlapping
=== RUN   TestAccM2Application_tags_DefaultTags_overlapping
=== PAUSE TestAccM2Application_tags_DefaultTags_overlapping
=== RUN   TestAccM2Application_tags_DefaultTags_updateToProviderOnly
=== PAUSE TestAccM2Application_tags_DefaultTags_updateToProviderOnly
=== RUN   TestAccM2Application_tags_DefaultTags_updateToResourceOnly
=== PAUSE TestAccM2Application_tags_DefaultTags_updateToResourceOnly
=== RUN   TestAccM2Application_tags_DefaultTags_emptyResourceTag
=== PAUSE TestAccM2Application_tags_DefaultTags_emptyResourceTag
=== RUN   TestAccM2Application_tags_DefaultTags_emptyProviderOnlyTag
=== PAUSE TestAccM2Application_tags_DefaultTags_emptyProviderOnlyTag
=== RUN   TestAccM2Application_tags_DefaultTags_nullOverlappingResourceTag
    application_tags_gen_test.go:1448: Tags with null values are not correctly handled with the Plugin Framework
--- SKIP: TestAccM2Application_tags_DefaultTags_nullOverlappingResourceTag (0.00s)
=== RUN   TestAccM2Application_tags_DefaultTags_nullNonOverlappingResourceTag
    application_tags_gen_test.go:1512: Tags with null values are not correctly handled with the Plugin Framework
--- SKIP: TestAccM2Application_tags_DefaultTags_nullNonOverlappingResourceTag (0.00s)
=== RUN   TestAccM2Application_tags_ComputedTag_OnCreate
=== PAUSE TestAccM2Application_tags_ComputedTag_OnCreate
=== RUN   TestAccM2Application_tags_ComputedTag_OnUpdate_Add
=== PAUSE TestAccM2Application_tags_ComputedTag_OnUpdate_Add
=== RUN   TestAccM2Application_tags_ComputedTag_OnUpdate_Replace
=== PAUSE TestAccM2Application_tags_ComputedTag_OnUpdate_Replace
=== RUN   TestAccM2Application_basic_Content
=== PAUSE TestAccM2Application_basic_Content
=== RUN   TestAccM2Application_basic_S3Location
=== PAUSE TestAccM2Application_basic_S3Location
=== RUN   TestAccM2Application_disappears
=== PAUSE TestAccM2Application_disappears
=== RUN   TestAccM2Application_full
=== PAUSE TestAccM2Application_full
=== RUN   TestAccM2Application_update
=== PAUSE TestAccM2Application_update
=== RUN   TestAccM2Environment_tags
=== PAUSE TestAccM2Environment_tags
=== RUN   TestAccM2Environment_tags_null
    environment_tags_gen_test.go:192: Tags with null values are not correctly handled with the Plugin Framework
--- SKIP: TestAccM2Environment_tags_null (0.00s)
=== RUN   TestAccM2Environment_tags_AddOnUpdate
=== PAUSE TestAccM2Environment_tags_AddOnUpdate
=== RUN   TestAccM2Environment_tags_EmptyTag_OnCreate
=== PAUSE TestAccM2Environment_tags_EmptyTag_OnCreate
=== RUN   TestAccM2Environment_tags_EmptyTag_OnUpdate_Add
=== PAUSE TestAccM2Environment_tags_EmptyTag_OnUpdate_Add
=== RUN   TestAccM2Environment_tags_EmptyTag_OnUpdate_Replace
=== PAUSE TestAccM2Environment_tags_EmptyTag_OnUpdate_Replace
=== RUN   TestAccM2Environment_tags_DefaultTags_providerOnly
=== PAUSE TestAccM2Environment_tags_DefaultTags_providerOnly
=== RUN   TestAccM2Environment_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccM2Environment_tags_DefaultTags_nonOverlapping
=== RUN   TestAccM2Environment_tags_DefaultTags_overlapping
=== PAUSE TestAccM2Environment_tags_DefaultTags_overlapping
=== RUN   TestAccM2Environment_tags_DefaultTags_updateToProviderOnly
=== PAUSE TestAccM2Environment_tags_DefaultTags_updateToProviderOnly
=== RUN   TestAccM2Environment_tags_DefaultTags_updateToResourceOnly
=== PAUSE TestAccM2Environment_tags_DefaultTags_updateToResourceOnly
=== RUN   TestAccM2Environment_tags_DefaultTags_emptyResourceTag
=== PAUSE TestAccM2Environment_tags_DefaultTags_emptyResourceTag
=== RUN   TestAccM2Environment_tags_DefaultTags_emptyProviderOnlyTag
=== PAUSE TestAccM2Environment_tags_DefaultTags_emptyProviderOnlyTag
=== RUN   TestAccM2Environment_tags_DefaultTags_nullOverlappingResourceTag
    environment_tags_gen_test.go:1448: Tags with null values are not correctly handled with the Plugin Framework
--- SKIP: TestAccM2Environment_tags_DefaultTags_nullOverlappingResourceTag (0.00s)
=== RUN   TestAccM2Environment_tags_DefaultTags_nullNonOverlappingResourceTag
    environment_tags_gen_test.go:1512: Tags with null values are not correctly handled with the Plugin Framework
--- SKIP: TestAccM2Environment_tags_DefaultTags_nullNonOverlappingResourceTag (0.00s)
=== RUN   TestAccM2Environment_tags_ComputedTag_OnCreate
=== PAUSE TestAccM2Environment_tags_ComputedTag_OnCreate
=== RUN   TestAccM2Environment_tags_ComputedTag_OnUpdate_Add
=== PAUSE TestAccM2Environment_tags_ComputedTag_OnUpdate_Add
=== RUN   TestAccM2Environment_tags_ComputedTag_OnUpdate_Replace
=== PAUSE TestAccM2Environment_tags_ComputedTag_OnUpdate_Replace
=== RUN   TestAccM2Environment_basic
=== PAUSE TestAccM2Environment_basic
=== RUN   TestAccM2Environment_disappears
=== PAUSE TestAccM2Environment_disappears
=== RUN   TestAccM2Environment_full
=== PAUSE TestAccM2Environment_full
=== RUN   TestAccM2Environment_update
=== PAUSE TestAccM2Environment_update
=== RUN   TestAccM2Environment_efs
=== PAUSE TestAccM2Environment_efs
=== RUN   TestAccM2Environment_fsx
=== PAUSE TestAccM2Environment_fsx
=== CONT  TestAccM2Application_tags
=== CONT  TestAccM2Environment_tags_AddOnUpdate
=== CONT  TestAccM2Environment_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccM2Application_tags (66.41s)
=== CONT  TestAccM2Environment_disappears
--- PASS: TestAccM2Environment_tags_DefaultTags_emptyProviderOnlyTag (469.53s)
=== CONT  TestAccM2Environment_fsx
--- PASS: TestAccM2Environment_tags_AddOnUpdate (476.40s)
=== CONT  TestAccM2Environment_efs
--- PASS: TestAccM2Environment_disappears (695.77s)
=== CONT  TestAccM2Environment_update
--- PASS: TestAccM2Environment_efs (606.63s)
=== CONT  TestAccM2Environment_full
--- PASS: TestAccM2Environment_full (550.49s)
=== CONT  TestAccM2Environment_tags_DefaultTags_nonOverlapping
--- PASS: TestAccM2Environment_fsx (1260.70s)
=== CONT  TestAccM2Environment_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccM2Environment_update (1082.04s)
=== CONT  TestAccM2Environment_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccM2Environment_tags_DefaultTags_emptyResourceTag (489.14s)
=== CONT  TestAccM2Environment_tags_DefaultTags_updateToProviderOnly
--- PASS: TestAccM2Environment_tags_DefaultTags_nonOverlapping (609.00s)
=== CONT  TestAccM2Environment_tags_DefaultTags_overlapping
--- PASS: TestAccM2Environment_tags_DefaultTags_updateToResourceOnly (464.46s)
=== CONT  TestAccM2Environment_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccM2Environment_tags_DefaultTags_updateToProviderOnly (506.60s)
=== CONT  TestAccM2Environment_tags_DefaultTags_providerOnly
--- PASS: TestAccM2Environment_tags_EmptyTag_OnUpdate_Replace (434.62s)
=== CONT  TestAccM2Environment_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccM2Environment_tags_DefaultTags_overlapping (508.31s)
=== CONT  TestAccM2Environment_basic
--- PASS: TestAccM2Environment_basic (468.48s)
=== CONT  TestAccM2Application_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccM2Environment_tags_ComputedTag_OnUpdate_Replace (501.14s)
=== CONT  TestAccM2Environment_tags
--- PASS: TestAccM2Application_tags_DefaultTags_emptyProviderOnlyTag (26.46s)
=== CONT  TestAccM2Application_update
--- PASS: TestAccM2Application_update (43.06s)
=== CONT  TestAccM2Application_full
--- PASS: TestAccM2Application_full (27.38s)
=== CONT  TestAccM2Application_disappears
--- PASS: TestAccM2Application_disappears (22.64s)
=== CONT  TestAccM2Application_basic_S3Location
--- PASS: TestAccM2Environment_tags_DefaultTags_providerOnly (622.16s)
=== CONT  TestAccM2Application_basic_Content
--- PASS: TestAccM2Application_basic_S3Location (29.34s)
=== CONT  TestAccM2Application_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccM2Application_basic_Content (24.58s)
=== CONT  TestAccM2Application_tags_ComputedTag_OnUpdate_Add
--- PASS: TestAccM2Application_tags_ComputedTag_OnUpdate_Replace (40.90s)
=== CONT  TestAccM2Application_tags_ComputedTag_OnCreate
--- PASS: TestAccM2Application_tags_ComputedTag_OnUpdate_Add (41.46s)
=== CONT  TestAccM2Application_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccM2Application_tags_ComputedTag_OnCreate (29.15s)
=== CONT  TestAccM2Application_tags_DefaultTags_providerOnly
--- PASS: TestAccM2Application_tags_EmptyTag_OnUpdate_Add (51.78s)
=== CONT  TestAccM2Application_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccM2Application_tags_EmptyTag_OnUpdate_Replace (37.12s)
=== CONT  TestAccM2Environment_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccM2Application_tags_DefaultTags_providerOnly (78.91s)
=== CONT  TestAccM2Environment_tags_ComputedTag_OnUpdate_Add
--- PASS: TestAccM2Environment_tags (529.99s)
=== CONT  TestAccM2Application_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccM2Application_tags_DefaultTags_updateToResourceOnly (42.02s)
=== CONT  TestAccM2Application_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccM2Application_tags_DefaultTags_emptyResourceTag (25.35s)
=== CONT  TestAccM2Environment_tags_EmptyTag_OnCreate
--- PASS: TestAccM2Environment_tags_ComputedTag_OnUpdate_Add (440.60s)
=== CONT  TestAccM2Application_tags_EmptyTag_OnCreate
--- PASS: TestAccM2Application_tags_EmptyTag_OnCreate (38.39s)
=== CONT  TestAccM2Environment_tags_ComputedTag_OnCreate
--- PASS: TestAccM2Environment_tags_EmptyTag_OnUpdate_Add (517.15s)
=== CONT  TestAccM2Application_tags_AddOnUpdate
--- PASS: TestAccM2Application_tags_AddOnUpdate (37.88s)
=== CONT  TestAccM2Application_tags_DefaultTags_updateToProviderOnly
--- PASS: TestAccM2Application_tags_DefaultTags_updateToProviderOnly (42.94s)
=== CONT  TestAccM2Application_tags_DefaultTags_nonOverlapping
--- PASS: TestAccM2Application_tags_DefaultTags_nonOverlapping (60.07s)
=== CONT  TestAccM2Application_tags_DefaultTags_overlapping
--- PASS: TestAccM2Application_tags_DefaultTags_overlapping (67.17s)
--- PASS: TestAccM2Environment_tags_EmptyTag_OnCreate (519.71s)
--- PASS: TestAccM2Environment_tags_ComputedTag_OnCreate (544.89s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/m2	4545.572s
% make testacc TESTARGS='-run=TestAccBedrockAgentAgentActionGroup_' PKG=bedrockagent ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/bedrockagent/... -v -count 1 -parallel 3  -run=TestAccBedrockAgentAgentActionGroup_ -timeout 360m
=== RUN   TestAccBedrockAgentAgentActionGroup_basic
=== PAUSE TestAccBedrockAgentAgentActionGroup_basic
=== RUN   TestAccBedrockAgentAgentActionGroup_s3APISchema
=== PAUSE TestAccBedrockAgentAgentActionGroup_s3APISchema
=== RUN   TestAccBedrockAgentAgentActionGroup_update
=== PAUSE TestAccBedrockAgentAgentActionGroup_update
=== CONT  TestAccBedrockAgentAgentActionGroup_basic
=== CONT  TestAccBedrockAgentAgentActionGroup_update
=== CONT  TestAccBedrockAgentAgentActionGroup_s3APISchema
--- PASS: TestAccBedrockAgentAgentActionGroup_s3APISchema (33.22s)
--- PASS: TestAccBedrockAgentAgentActionGroup_basic (37.69s)
--- PASS: TestAccBedrockAgentAgentActionGroup_update (58.26s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/bedrockagent	65.216s

aws_appfabric_ingestion_destination, which has union types but is not yet migrated.

% AWS_APPFABRIC_TERRAFORMCLOUD_TENANT_ID=... AWS_APPFABRIC_TERRAFORMCLOUD_SERVICE_ACCOUNT_TOKEN=... AWS_DEFAULT_REGION=us-east-1 make testacc TESTARGS='-run=TestAccAppFabric_serial/IngestionDestination' PKG=appfabric
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/appfabric/... -v -count 1 -parallel 20  -run=TestAccAppFabric_serial/IngestionDestination -timeout 360m
=== RUN   TestAccAppFabric_serial
=== PAUSE TestAccAppFabric_serial
=== CONT  TestAccAppFabric_serial
=== RUN   TestAccAppFabric_serial/IngestionDestination
=== RUN   TestAccAppFabric_serial/IngestionDestination/disappears
=== RUN   TestAccAppFabric_serial/IngestionDestination/tags
=== RUN   TestAccAppFabric_serial/IngestionDestination/update
=== RUN   TestAccAppFabric_serial/IngestionDestination/firehose
=== RUN   TestAccAppFabric_serial/IngestionDestination/basic
--- PASS: TestAccAppFabric_serial (189.40s)
    --- PASS: TestAccAppFabric_serial/IngestionDestination (189.40s)
        --- PASS: TestAccAppFabric_serial/IngestionDestination/disappears (19.20s)
        --- PASS: TestAccAppFabric_serial/IngestionDestination/tags (30.30s)
        --- PASS: TestAccAppFabric_serial/IngestionDestination/update (24.89s)
        --- PASS: TestAccAppFabric_serial/IngestionDestination/firehose (95.37s)
        --- PASS: TestAccAppFabric_serial/IngestionDestination/basic (19.64s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appfabric	194.119s

@gdavison gdavison merged commit d49381a into main Jul 8, 2024
46 checks passed
@gdavison gdavison deleted the td-autoflex-union-types-expand branch July 8, 2024 21:05
@github-actions github-actions bot added this to the v5.58.0 milestone Jul 8, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 12, 2024
Copy link

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

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 Aug 12, 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. service/bedrock Issues and PRs that pertain to the bedrock service. service/bedrockagent Issues and PRs that pertain to the bedrockagent service. service/fsx Issues and PRs that pertain to the fsx service. service/m2 Issues and PRs that pertain to the m2 service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants