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

feat(cognito): user pool feature plans #32367

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

Tietew
Copy link
Contributor

@Tietew Tietew commented Dec 3, 2024

Issue # (if applicable)

N/A

Reason for this change

Amazon Cognito introduces the feature plans which replaces the Advanced Security Mode.
See: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-sign-in-feature-plans.html

Related to #32369 - passwordless sign-in requires Essentials or higher feature plan.

Description of changes

  • Add new featurePlan property and FeaturePlan enum to specify user pool feature plan.
  • Deprecate advancedSecurityMode property and AdvancedSecurityMode enum.

Note that the previous AWS document about Advanced Security Mode is now redirected to Advanced security with threat protection.

Description of how you validated changes

Added new unit tests and an integ test.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team December 3, 2024 05:28
@github-actions github-actions bot added admired-contributor [Pilot] contributed between 13-24 PRs to the CDK p2 labels Dec 3, 2024
props.advancedSecurityMode && props.advancedSecurityMode !== AdvancedSecurityMode.OFF
) {
throw new Error('you cannot enable Advanced Security Mode when feature plan is Essentials or higher.');
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the advanced security mode is enabled with Essentials or Plus feature plan, CloudFormation will fail with following error:

Resource handler returned message: "The following features need to be disabled for the ESSENTIALS pricing tier configured: Threat Protection (Service: CognitoIdenti
tyProvider, Status Code: 400, Request ID: xx)"

We cannot validate advancedSecurityMode is off when featurePlan is not specified (defaults to Essentials) because existing user pools are set to Lite feature plan for backward compatibility and CDK cannot determine what the actual feature plan is.

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.66%. Comparing base (f4c19c7) to head (0be6672).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #32367      +/-   ##
==========================================
- Coverage   78.67%   78.66%   -0.02%     
==========================================
  Files         107      107              
  Lines        7237     7237              
  Branches     1329     1329              
==========================================
- Hits         5694     5693       -1     
- Misses       1357     1358       +1     
  Partials      186      186              
Flag Coverage Δ
suite.unit 78.66% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 78.66% <ø> (-0.02%) ⬇️

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 3, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

One comment on the validation part.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 3, 2024
@Tietew
Copy link
Contributor Author

Tietew commented Dec 4, 2024

@Mergifyio update

Copy link
Contributor

mergify bot commented Dec 4, 2024

update

✅ Branch has been successfully updated

Copy link
Contributor

mergify bot commented Dec 5, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@Tietew
Copy link
Contributor Author

Tietew commented Dec 5, 2024

@Mergifyio update

Copy link
Contributor

mergify bot commented Dec 5, 2024

update

✅ Branch has been successfully updated

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0be6672
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Dec 6, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@GavinZZ GavinZZ merged commit 39c22de into aws:main Dec 6, 2024
13 of 15 checks passed
Copy link

github-actions bot commented Dec 6, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 6, 2024
@Tietew Tietew deleted the cognito-userpool-feature-plans branch December 7, 2024 03:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants