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

BugFix: Fixes 400 error in dataSourceUserPoolClientRead #38168

Merged
merged 4 commits into from
Jun 28, 2024

Conversation

t-oki
Copy link
Contributor

@t-oki t-oki commented Jun 28, 2024

Description

Fixes the bug in dataSourceUserPoolClientRead and adds additional acceptance test.
The bug seems to be introduced in the PR below.
https://github.com/hashicorp/terraform-provider-aws/pull/37024/files#diff-7756a038996f7336f61d258833fecdc9c15d8a139179e33686cbbde60b920d5eR190

Relations

Closes #38167.
Relates #37024.

References

Output from Acceptance Testing

before

-> % make testacc TESTARGS='-run=TestAccCognitoIDPUserPoolClientDataSource_' PKG=cognitoidp 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/cognitoidp/... -v -count 1 -parallel 3  -run=TestAccCognitoIDPUserPoolClientDataSource_ -timeout 360m
=== RUN   TestAccCognitoIDPUserPoolClientDataSource_basic
=== PAUSE TestAccCognitoIDPUserPoolClientDataSource_basic
=== CONT  TestAccCognitoIDPUserPoolClientDataSource_basic
    user_pool_client_data_source_test.go:22: Step 1/1 error: Error running apply: exit status 1

        Error: reading Cognito User Pool Client (1vhdb3971704qgf16a7be9dinj): operation error Cognito Identity Provider: DescribeUserPoolClient, https response error StatusCode: 400, RequestID: 945a7c16-7813-4e3c-97c0-eb367b712c01, InvalidParameterException: 2 validation errors detected: Value '' at 'clientId' failed to satisfy constraint: Member must have length greater than or equal to 1; Value '' at 'clientId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w+]+

          with data.aws_cognito_user_pool_client.test,
          on terraform_plugin_test.tf line 22, in data "aws_cognito_user_pool_client" "test":
          22: data "aws_cognito_user_pool_client" "test" {

--- FAIL: TestAccCognitoIDPUserPoolClientDataSource_basic (9.87s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp	13.447s
FAIL
make: *** [testacc] Error 1

...

after

-> % make testacc TESTARGS='-run=TestAccCognitoIDPUserPoolClientDataSource_' PKG=cognitoidp 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/cognitoidp/... -v -count 1 -parallel 3  -run=TestAccCognitoIDPUserPoolClientDataSource_ -timeout 360m
=== RUN   TestAccCognitoIDPUserPoolClientDataSource_basic
=== PAUSE TestAccCognitoIDPUserPoolClientDataSource_basic
=== CONT  TestAccCognitoIDPUserPoolClientDataSource_basic
--- PASS: TestAccCognitoIDPUserPoolClientDataSource_basic (12.17s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp	15.749s

@t-oki t-oki requested a review from a team as a code owner June 28, 2024 03:19
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/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/cognitoidp Issues and PRs that pertain to the cognitoidp service. labels Jun 28, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 28, 2024
@t-oki t-oki changed the title fix 400 error in dataSourceUserPoolClientRead BugFix: Fixes 400 error in dataSourceUserPoolClientRead Jun 28, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @t-oki 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jun 28, 2024
@ewbankkit ewbankkit self-assigned this Jun 28, 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 Jun 28, 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=TestAccCognitoIDPUserPoolClientDataSource_' PKG=cognitoidp
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/cognitoidp/... -v -count 1 -parallel 20  -run=TestAccCognitoIDPUserPoolClientDataSource_ -timeout 360m
=== RUN   TestAccCognitoIDPUserPoolClientDataSource_basic
=== PAUSE TestAccCognitoIDPUserPoolClientDataSource_basic
=== CONT  TestAccCognitoIDPUserPoolClientDataSource_basic
--- PASS: TestAccCognitoIDPUserPoolClientDataSource_basic (11.42s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp	16.088s

@ewbankkit
Copy link
Contributor

@t-oki Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 5b43711 into hashicorp:main Jun 28, 2024
37 checks passed
@github-actions github-actions bot added this to the v5.57.0 milestone Jun 28, 2024
Copy link

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

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jun 28, 2024
Copy link

github-actions bot commented Aug 1, 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 Aug 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/cognitoidp Issues and PRs that pertain to the cognitoidp service. size/XS 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.

[Bug]: status 400 from DescribeUserPoolClient when using data aws_cognito_user_pool_client
2 participants