Please add your +1 👍 to let us know you have encountered this
Status: IN-PROGRESS
Overview:
Describe the bug
Upgrading past v2.178.2 causes deployment of stack with existing (deployed with version <= 2.178.2) identity pool to fail.
Last Known Working CDK Version
2.178.2
Expected Behavior
Stack to deploy without issues.
Current Behavior
Deployment fails with the following error:
The stack named AwsCdkReproStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Resource handler returned message: "Resource of type 'AWS::Cognito::IdentityPoolRoleAttachment' with identifier 'eu-north-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' already exists." (RequestToken: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx, HandlerErrorCode: AlreadyExists)
Reproduction Steps
npx aws-cdk@2.178.2 init app --language typescript
npm add @aws-cdk/aws-cognito-identitypool-alpha@2.178.2-alpha.0
Add an identity pool to the stack, e.g.:
import { IdentityPool } from "@aws-cdk/aws-cognito-identitypool-alpha";
import * as cdk from "aws-cdk-lib";
import { Construct } from "constructs";
export class AwsCdkReproStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new IdentityPool(this, "IdentityPool");
}
}
npm i aws-cdk@2.179.0 aws-cdk-lib@2.179.0 @aws-cdk/aws-cognito-identitypool-alpha@2.179.0-alpha.0
Workaround
Bump to the latest CDK library version, v2.181.1.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.179.0
Framework Version
No response
Node.js Version
22.14.0
OS
macOS 15.3.1
Language
TypeScript
Language Version
No response
Other information
No response