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

Make the recovery_mechanism optional in account_recovery_settings #22302

Merged
merged 6 commits into from Mar 15, 2023

Conversation

jakemillerkasasa
Copy link
Contributor

@jakemillerkasasa jakemillerkasasa commented Dec 21, 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

Closes #21143.
Closes #30030.

I found that the schema for account_recovery_setting resource had the recovery_mechanisms property as required when it is optionals with max size of two in the AWS documentation. The terraform documentation mirrors what the code was previously enforcing though.

Output from acceptance testing:

$ make testacc TESTS=TestAccCognitoIDPUserPool_recovery PKG=cognitoidp
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cognitoidp/... -v -count 1 -parallel 20 -run='TestAccCognitoIDPUserPool_recovery' -timeout 180m
=== RUN   TestAccCognitoIDPUserPool_recovery
=== PAUSE TestAccCognitoIDPUserPool_recovery
=== CONT  TestAccCognitoIDPUserPool_recovery
--- PASS: TestAccCognitoIDPUserPool_recovery (44.59s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp	45.670s 

...

@github-actions github-actions bot added service/cognitoidentityprovider needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. labels Dec 21, 2021
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 @jakemillerkasasa 👋

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 CONTRIBUTING 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 Dec 21, 2021
@AdamTylerLynch
Copy link
Collaborator

Verified docs and usage. LGTM 🚀

@jakemillerkasasa
Copy link
Contributor Author

Hello, do we have insight on when this might get merged and if there is a targeted release to expect to see this change in? Thanks!

@ewbankkit ewbankkit added the service/cognitoidp Issues and PRs that pertain to the cognitoidp service. label Aug 4, 2022
@bengaywins
Copy link

bengaywins commented Sep 8, 2022

@AdamTylerLynch or @ewbankkit Any way to get this pushed through? We have user pools that do not need recovery mechanisms and this blocks that ability.

@github-actions github-actions bot added size/L 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. and removed size/XS Managed by automation to categorize the size of a PR. labels Mar 15, 2023
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=TestAccCognitoIDPUserPool_recovery\|TestAccCognitoIDPUserPool_basic' PKG=cognitoidp ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cognitoidp/... -v -count 1 -parallel 2  -run=TestAccCognitoIDPUserPool_recovery\|TestAccCognitoIDPUserPool_basic -timeout 180m
=== RUN   TestAccCognitoIDPUserPool_basic
=== PAUSE TestAccCognitoIDPUserPool_basic
=== RUN   TestAccCognitoIDPUserPool_recovery
=== PAUSE TestAccCognitoIDPUserPool_recovery
=== CONT  TestAccCognitoIDPUserPool_basic
=== CONT  TestAccCognitoIDPUserPool_recovery
--- PASS: TestAccCognitoIDPUserPool_basic (19.01s)
--- PASS: TestAccCognitoIDPUserPool_recovery (40.93s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp	46.251s

@ewbankkit
Copy link
Contributor

@jakemillerkasasa Thanks for the contribution 🎉 👏.
Since your changes it seems that AWS are now provisioning default account recovery settings:

If you do not specify AccountRecoverySetting, Amazon Cognito uses the legacy mechanism to determine the password recovery method. In this case, Cognito uses a verified phone first. If the verified phone is not found for the user, Cognito falls back and will use verified email next.

So I changed the attribute to Optional + Computed.

@ewbankkit ewbankkit merged commit d24c778 into hashicorp:main Mar 15, 2023
46 checks passed
@github-actions github-actions bot added this to the v4.59.0 milestone Mar 15, 2023
@github-actions
Copy link

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

@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 Apr 16, 2023
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/cognitoidp Issues and PRs that pertain to the cognitoidp service. size/L 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
5 participants