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

Tech debt: Migrate cognitoidentity resources to AWS SDK for Go v2 #36100

Merged
merged 14 commits into from
Mar 8, 2024

Conversation

danquack
Copy link
Contributor

@danquack danquack commented Mar 5, 2024

Description

🚚 Bringing Cognito Identity to use the next version of AWS SDK

Relations

Relates #32976
Closes #36130

References

Output from Acceptance Testing

% TF_ACC=1 make testacc TESTS=TestAccCognitoIdentityPool ACCTEST_PARALLELISM=1  PKG=cognitoidentity                      <aws:default>
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cognitoidentity/... -v -count 1 -parallel 1 -run='TestAccCognitoIdentityPool'  -timeout 360m
=== RUN   TestAccCognitoIdentityPoolDataSource_basic
=== PAUSE TestAccCognitoIdentityPoolDataSource_basic
=== RUN   TestAccCognitoIdentityPoolDataSource_openidConnectProviderARNs
=== PAUSE TestAccCognitoIdentityPoolDataSource_openidConnectProviderARNs
=== RUN   TestAccCognitoIdentityPoolDataSource_cognitoIdentityProviders
=== PAUSE TestAccCognitoIdentityPoolDataSource_cognitoIdentityProviders
=== RUN   TestAccCognitoIdentityPoolDataSource_samlProviderARNs
=== PAUSE TestAccCognitoIdentityPoolDataSource_samlProviderARNs
=== RUN   TestAccCognitoIdentityPoolDataSource_supportedLoginProviders
=== PAUSE TestAccCognitoIdentityPoolDataSource_supportedLoginProviders
=== RUN   TestAccCognitoIdentityPoolDataSource_tags
=== PAUSE TestAccCognitoIdentityPoolDataSource_tags
=== RUN   TestAccCognitoIdentityPoolProviderPrincipalTags_basic
=== PAUSE TestAccCognitoIdentityPoolProviderPrincipalTags_basic
=== RUN   TestAccCognitoIdentityPoolProviderPrincipalTags_updated
=== PAUSE TestAccCognitoIdentityPoolProviderPrincipalTags_updated
=== RUN   TestAccCognitoIdentityPoolProviderPrincipalTags_disappears
=== PAUSE TestAccCognitoIdentityPoolProviderPrincipalTags_disappears
=== RUN   TestAccCognitoIdentityPoolProviderPrincipalTags_oidc
=== PAUSE TestAccCognitoIdentityPoolProviderPrincipalTags_oidc
=== RUN   TestAccCognitoIdentityPoolRolesAttachment_basic
=== PAUSE TestAccCognitoIdentityPoolRolesAttachment_basic
=== RUN   TestAccCognitoIdentityPoolRolesAttachment_roleMappings
=== PAUSE TestAccCognitoIdentityPoolRolesAttachment_roleMappings
=== RUN   TestAccCognitoIdentityPoolRolesAttachment_disappears
=== PAUSE TestAccCognitoIdentityPoolRolesAttachment_disappears
=== RUN   TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithAmbiguousRoleResolutionError
=== PAUSE TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithAmbiguousRoleResolutionError
=== RUN   TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithRulesTypeError
=== PAUSE TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithRulesTypeError
=== RUN   TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithTokenTypeError
=== PAUSE TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithTokenTypeError
=== RUN   TestAccCognitoIdentityPool_basic
=== PAUSE TestAccCognitoIdentityPool_basic
=== RUN   TestAccCognitoIdentityPool_DeveloperProviderName
=== PAUSE TestAccCognitoIdentityPool_DeveloperProviderName
=== RUN   TestAccCognitoIdentityPool_supportedLoginProviders
=== PAUSE TestAccCognitoIdentityPool_supportedLoginProviders
=== RUN   TestAccCognitoIdentityPool_openidConnectProviderARNs
=== PAUSE TestAccCognitoIdentityPool_openidConnectProviderARNs
=== RUN   TestAccCognitoIdentityPool_samlProviderARNs
=== PAUSE TestAccCognitoIdentityPool_samlProviderARNs
=== RUN   TestAccCognitoIdentityPool_cognitoIdentityProviders
=== PAUSE TestAccCognitoIdentityPool_cognitoIdentityProviders
=== RUN   TestAccCognitoIdentityPool_addingNewProviderKeepsOldProvider
--- PASS: TestAccCognitoIdentityPool_addingNewProviderKeepsOldProvider (49.31s)
=== RUN   TestAccCognitoIdentityPool_tags
=== PAUSE TestAccCognitoIdentityPool_tags
=== RUN   TestAccCognitoIdentityPool_disappears
=== PAUSE TestAccCognitoIdentityPool_disappears
=== CONT  TestAccCognitoIdentityPoolDataSource_basic
    pool_data_source_test.go:33: skipping tests; partition aws does not support Cognito Identity service
--- SKIP: TestAccCognitoIdentityPoolDataSource_basic (0.00s)
=== CONT  TestAccCognitoIdentityPool_disappears
--- PASS: TestAccCognitoIdentityPool_disappears (18.49s)
=== CONT  TestAccCognitoIdentityPool_tags
--- PASS: TestAccCognitoIdentityPool_tags (45.56s)
=== CONT  TestAccCognitoIdentityPool_cognitoIdentityProviders
--- PASS: TestAccCognitoIdentityPool_cognitoIdentityProviders (48.02s)
=== CONT  TestAccCognitoIdentityPool_samlProviderARNs
--- PASS: TestAccCognitoIdentityPool_samlProviderARNs (38.39s)
=== CONT  TestAccCognitoIdentityPool_openidConnectProviderARNs
--- PASS: TestAccCognitoIdentityPool_openidConnectProviderARNs (34.27s)
=== CONT  TestAccCognitoIdentityPool_supportedLoginProviders
--- PASS: TestAccCognitoIdentityPool_supportedLoginProviders (34.73s)
=== CONT  TestAccCognitoIdentityPool_DeveloperProviderName
--- PASS: TestAccCognitoIdentityPool_DeveloperProviderName (25.44s)
=== CONT  TestAccCognitoIdentityPool_basic
--- PASS: TestAccCognitoIdentityPool_basic (25.17s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithTokenTypeError
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithTokenTypeError (8.93s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithRulesTypeError
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithRulesTypeError (8.68s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithAmbiguousRoleResolutionError
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithAmbiguousRoleResolutionError (8.83s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_disappears
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_disappears (14.95s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_roleMappings
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_roleMappings (48.08s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_basic
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_basic (28.52s)
=== CONT  TestAccCognitoIdentityPoolProviderPrincipalTags_oidc
--- PASS: TestAccCognitoIdentityPoolProviderPrincipalTags_oidc (13.95s)
=== CONT  TestAccCognitoIdentityPoolProviderPrincipalTags_disappears
--- PASS: TestAccCognitoIdentityPoolProviderPrincipalTags_disappears (16.52s)
=== CONT  TestAccCognitoIdentityPoolProviderPrincipalTags_updated
--- PASS: TestAccCognitoIdentityPoolProviderPrincipalTags_updated (29.20s)
=== CONT  TestAccCognitoIdentityPoolProviderPrincipalTags_basic
--- PASS: TestAccCognitoIdentityPoolProviderPrincipalTags_basic (16.00s)
=== CONT  TestAccCognitoIdentityPoolDataSource_tags
    pool_data_source_test.go:206: skipping tests; partition aws does not support Cognito Identity service
--- SKIP: TestAccCognitoIdentityPoolDataSource_tags (0.00s)
=== CONT  TestAccCognitoIdentityPoolDataSource_supportedLoginProviders
    pool_data_source_test.go:172: skipping tests; partition aws does not support Cognito Identity service
--- SKIP: TestAccCognitoIdentityPoolDataSource_supportedLoginProviders (0.00s)
=== CONT  TestAccCognitoIdentityPoolDataSource_samlProviderARNs
    pool_data_source_test.go:138: skipping tests; partition aws does not support Cognito Identity service
--- SKIP: TestAccCognitoIdentityPoolDataSource_samlProviderARNs (0.00s)
=== CONT  TestAccCognitoIdentityPoolDataSource_cognitoIdentityProviders
    pool_data_source_test.go:103: skipping tests; partition aws does not support Cognito Identity service
--- SKIP: TestAccCognitoIdentityPoolDataSource_cognitoIdentityProviders (0.00s)
=== CONT  TestAccCognitoIdentityPoolDataSource_openidConnectProviderARNs
    pool_data_source_test.go:69: skipping tests; partition aws does not support Cognito Identity service
--- SKIP: TestAccCognitoIdentityPoolDataSource_openidConnectProviderARNs (0.00s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidentity    516.090s

Copy link

github-actions bot commented Mar 5, 2024

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. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. tags Pertains to resource tagging. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. service/cognitoidentity Issues and PRs that pertain to the cognitoidentity service. labels Mar 5, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 5, 2024
Copy link

github-actions bot commented Mar 5, 2024

Thank you for your contribution! 🚀

Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

@danquack danquack force-pushed the cognito-identity-sdk branch from 3a9274c to 6876dd8 Compare March 5, 2024 19:39
@danquack danquack force-pushed the cognito-identity-sdk branch from 248081e to c27ed6d Compare March 5, 2024 20:07
@ewbankkit ewbankkit added the aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. label Mar 5, 2024
@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Mar 6, 2024
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

A couple suggestions on pagination and validators.

internal/service/cognitoidentity/pool.go Show resolved Hide resolved
internal/service/cognitoidentity/pool_data_source.go Outdated Show resolved Hide resolved
internal/service/cognitoidentity/pool_roles_attachment.go Outdated Show resolved Hide resolved
internal/service/cognitoidentity/pool_roles_attachment.go Outdated Show resolved Hide resolved
internal/service/cognitoidentity/pool_roles_attachment.go Outdated Show resolved Hide resolved
danquack and others added 5 commits March 6, 2024 10:40
Co-authored-by: Jared Baker <jar-b@users.noreply.github.com>
Co-authored-by: Jared Baker <jar-b@users.noreply.github.com>
Co-authored-by: Jared Baker <jar-b@users.noreply.github.com>
@jar-b jar-b self-assigned this Mar 7, 2024
@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 Mar 7, 2024
Copy link
Member

@jar-b jar-b 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 PKG=cognitoidentity
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cognitoidentity/... -v -count 1 -parallel 20   -timeout 360m

--- PASS: TestEndpointConfiguration (0.52s)
    --- PASS: TestEndpointConfiguration/no_config (0.05s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_aws_service_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_base_config_file (0.05s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar (0.02s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_base_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/service_config_file_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_service_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar (0.02s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_base_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar_overrides_service_config_file (0.02s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config (0.04s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar_overrides_base_config_file (0.03s)
=== CONT  TestAccCognitoIdentityPoolProviderPrincipalTags_disappears
=== CONT  TestAccCognitoIdentityPoolProviderPrincipalTags_basic
=== CONT  TestAccCognitoIdentityPoolDataSource_tags
=== CONT  TestValidSupportedLoginProviders
=== CONT  TestAccCognitoIdentityPoolDataSource_cognitoIdentityProviders
=== CONT  TestAccCognitoIdentityPoolDataSource_openidConnectProviderARNs
=== CONT  TestAccCognitoIdentityPool_basic
=== CONT  TestAccCognitoIdentityPool_samlProviderARNs
--- PASS: TestValidSupportedLoginProviders (0.00s)
=== CONT  TestAccCognitoIdentityPoolDataSource_basic
=== CONT  TestValidRoles
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithRulesTypeError
--- PASS: TestValidRoles (0.00s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithTokenTypeError
=== CONT  TestValidRoleMappingsRulesConfiguration
--- PASS: TestValidRoleMappingsRulesConfiguration (0.00s)
=== CONT  TestAccCognitoIdentityPoolDataSource_samlProviderARNs
=== CONT  TestAccCognitoIdentityPoolProviderPrincipalTags_oidc
=== CONT  TestValidProviderDeveloperName
--- PASS: TestValidProviderDeveloperName (0.00s)
=== CONT  TestValidIdentityPoolName
--- PASS: TestValidIdentityPoolName (0.00s)
=== CONT  TestValidIdentityProvidersProviderName
=== CONT  TestAccCognitoIdentityPool_tags
--- PASS: TestValidIdentityProvidersProviderName (0.00s)
=== CONT  TestValidIdentityProvidersClientID
=== CONT  TestAccCognitoIdentityPoolProviderPrincipalTags_updated
=== CONT  TestAccCognitoIdentityPool_supportedLoginProviders
=== CONT  TestAccCognitoIdentityPool_disappears
=== CONT  TestAccCognitoIdentityPool_DeveloperProviderName
--- PASS: TestValidIdentityProvidersClientID (0.00s)
=== CONT  TestAccCognitoIdentityPool_openidConnectProviderARNs
=== CONT  TestValidRoleMappingsAmbiguousRoleResolutionAgainstType
--- PASS: TestValidRoleMappingsAmbiguousRoleResolutionAgainstType (0.00s)
=== CONT  TestAccCognitoIdentityPool_cognitoIdentityProviders
=== CONT  TestAccCognitoIdentityPoolDataSource_supportedLoginProviders
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithTokenTypeError (15.21s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_roleMappings
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithRulesTypeError (16.22s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithAmbiguousRoleResolutionError
--- PASS: TestAccCognitoIdentityPoolDataSource_openidConnectProviderARNs (28.97s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_disappears
--- PASS: TestAccCognitoIdentityPoolDataSource_cognitoIdentityProviders (28.98s)
=== CONT  TestAccCognitoIdentityPoolRolesAttachment_basic
--- PASS: TestAccCognitoIdentityPoolDataSource_basic (29.05s)
--- PASS: TestAccCognitoIdentityPool_disappears (29.08s)
--- PASS: TestAccCognitoIdentityPoolDataSource_supportedLoginProviders (29.22s)
--- PASS: TestAccCognitoIdentityPoolDataSource_tags (29.24s)
--- PASS: TestAccCognitoIdentityPoolProviderPrincipalTags_oidc (29.57s)
--- PASS: TestAccCognitoIdentityPoolDataSource_samlProviderARNs (29.70s)
--- PASS: TestAccCognitoIdentityPoolProviderPrincipalTags_basic (30.89s)
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithAmbiguousRoleResolutionError (15.14s)
--- PASS: TestAccCognitoIdentityPoolProviderPrincipalTags_disappears (32.11s)
--- PASS: TestAccCognitoIdentityPool_DeveloperProviderName (44.47s)
--- PASS: TestAccCognitoIdentityPool_basic (45.46s)
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_disappears (17.04s)
--- PASS: TestAccCognitoIdentityPoolProviderPrincipalTags_updated (46.91s)
--- PASS: TestAccCognitoIdentityPool_tags (52.98s)
--- PASS: TestAccCognitoIdentityPool_openidConnectProviderARNs (53.69s)
--- PASS: TestAccCognitoIdentityPool_supportedLoginProviders (53.76s)
--- PASS: TestAccCognitoIdentityPool_cognitoIdentityProviders (53.79s)
--- PASS: TestAccCognitoIdentityPool_samlProviderARNs (54.00s)
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_basic (29.09s)
--- PASS: TestAccCognitoIdentityPoolRolesAttachment_roleMappings (51.13s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidentity    96.889s

@jar-b
Copy link
Member

jar-b commented Mar 7, 2024

Thanks for your contribution, @danquack ! 👍

@jar-b jar-b merged commit e1f3dd9 into hashicorp:main Mar 8, 2024
43 checks passed
@github-actions github-actions bot added this to the v5.41.0 milestone Mar 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 Mar 14, 2024
Copy link

This functionality has been released in v5.41.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 Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aws-sdk-go-migration Issues that are related to the providers migration to AWS SDK for Go v2. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. service/cognitoidentity Issues and PRs that pertain to the cognitoidentity service. size/XL Managed by automation to categorize the size of a PR. tags Pertains to resource tagging. 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.

[AWS SDK for Go Migration] Cognito Identity Service
4 participants