-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Describe the bug
Hello,
We have existing userpools that use advancedSecurityMode: cognito.AdvancedSecurityMode.AUDIT, wich is deprecated with the new version, but the main point is that cdk is blocking the deployment because of a validation error:
ValidationError: you cannot enable Threat Protection when feature plan is not Plus
This should not be there for existing deployments, since they still can use the threat protection while using just the default lite protection plan.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
2.160.0
Expected Behavior
I should be able to do a cdk diff & deploy without getting blocked by a Validation Error that only counts for new deployments
Current Behavior
I get a validation error during a cdk diff:
ValidationError: you cannot enable Threat Protection when feature plan is not Plus
Even though my userpool is old and is not actually affected by this.
Reproduction Steps
Use version v2.223.0
Have an existing userpool that is older than one year and has an advancedSecurityMode attribute set.
const pool = new cognito.UserPool(this, `xyz`, {
userPoolName: 'xyz',
advancedSecurityMode: cognito.AdvancedSecurityMode.AUDIT,
.....
Possible Solution
Remove the validation on cdk level and let the error be handled by aws cloudformation during deployment.
Additional Information/Context
New user pools start in essential feature plan and can upgrade to plus.
Existing user pools are using a lite plan and can upgrade either to essentials or plus plan ( atleast in our case). Additionally our existing 1+ year old user pools that run in light plan can use the threat protection without problems.
AWS CDK Library version (aws-cdk-lib)
2.223.0
AWS CDK CLI version
2.1031.2
Node.js Version
24.10.0
OS
MacOs Tahoe 26.0.1
Language
TypeScript
Language Version
No response
Other information
No response