Skip to content

NOTICE: aws-cognito-identitypool-alpha: "Resource of type 'AWS::Cognito::IdentityPoolRoleAttachment' with identifier '[...]' already exists." >=2.179.0 breaks deployment of existing identity pools #33510

@monholm

Description

@monholm

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 [email protected] init app --language typescript
npm add @aws-cdk/[email protected]

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");
  }
}
cdk deploy
cdk deploy

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions