Skip to content

Cognito User Pool: CDK Version update blocking existing user pools threat protection #36023

@HeikoMR

Description

@HeikoMR

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.

Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cognitoRelated to Amazon CognitobugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1potential-regressionMarking this issue as a potential regression to be checked by team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions