(hotswap): CLI --hotswap -> We don't support attributes of the 'AWS::Cognito::UserPool' resource.
- Dominant language
- TypeScript
- Stars
- 105
- Forks
- 122
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 71
Description
### Describe the bug
I have a stack that has a nested stack
The parent stack instantiate many resources, including a Cognito UserPool. The nested stack has only Lambda function, which use some attributes of the UserPool. When deploying and using the hotswap option, the deployment fails.
### Expected Behavior
I expect the hotswap option to succeed, and successfully deploy the lambda functions in my nested stack.
### Current Behavior
I get the following error:
```
Could not perform a hotswap deployment, because the CloudFormation template could not be resolved: We don't support attributes of the 'AWS::Cognito::UserPool' resource. This is a CDK limitation. Please report it at https://github.com/aws/aws-cdk/issues/new/choose
```
### Reproduction Steps
bin/index.ts
```ts
#!/usr/bin/env node
import { App } from "aws-cdk-lib";
import "source-map-support/register";
import { StackOne } from "./test";
const app = new App();
const test = new StackOne(app, "my-stack", { env: { region: "", account: "" } });
```
lib/index.ts
```ts
import { NestedStack, NestedStackProps, Stack, StackProps } from "aws-cdk-lib";
import { Construct } from "constructs";
import { UserPool, StringAttribute } from "aws-cdk-lib/aws-cognito";
import { NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs";
type Props = NestedStackProps & {
userPoolId: string;
userPoolArn: string;
};
export class StackTwo extends NestedStack {
constructor(scope: Construct, id: string, props: Props) {
super(scope, id, props);
new NodejsFunction(this, "my-lambda", {
entry: "./test/handler.ts",
handler: "main",
environment: {
POOL_ID: props.userPoolId,
POOL_ARN: props.userPoolArn,
},
});
}
}
export class StackOne extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, {
...props,
});
const userPool = new UserPool(this, "test-userpool", {
userPoolName: "test-userpool",
signInCaseSensitive: false, // case insensitive is preferred in most situations
selfSignUpEnabled: true,
standardAttributes: {
preferredUsername: {
mutable: true,
required: true,
},
},
customAttributes: {
appUsername: new StringAttribute({ minLen: 3, maxLen: 20, mutable: true }),
},
signInAliases: { email: true },
autoVerify: { email: true },
});
new StackTwo(this, "my-stack-two", {
userPoolArn: userPool.userPoolArn,
userPoolId: userPool.userPoolId,
});
}
}
```
lib/handler.ts
```
export const main = () => {};
```
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.108.1 (build 2320255)
### Framework Version
_No response_
### Node.js Version
v18.16.0
### OS
Linux
### Language
TypeScript
### Language Version
TypeScript 4.8.4
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.