-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1package/toolsRelated to AWS CDK Tools or CLIRelated to AWS CDK Tools or CLI

Description
Describe the bug
The CDK crashes when attempting to add tags to a lambda function while using hotswap.
Expected Behavior
The tags are added to the lambda function.
Current Behavior
❌ TestStack failed: TypeError: Cannot read properties of undefined (reading 'forEach')
at isLambdaFunctionCodeOnlyChange (/Users/test/node_modules/aws-cdk/lib/api/hotswap/lambda-functions.ts:169:32)
at isHotswappableLambdaFunctionChange (/Users/test/node_modules/aws-cdk/lib/api/hotswap/lambda-functions.ts:34:34)
at findAllHotswappableChanges (/Users/test/node_modules/aws-cdk/lib/api/hotswap-deployments.ts:96:9)
at tryHotswapDeployment (/Users/test/node_modules/aws-cdk/lib/api/hotswap-deployments.ts:50:37)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at deployStack (/Users/test/node_modules/aws-cdk/lib/api/deploy-stack.ts:274:39)
at CdkToolkit.deploy (/Users/test/node_modules/aws-cdk/lib/cdk-toolkit.ts:210:24)
at initCommandLine (/Users/test/node_modules/aws-cdk/lib/cli.ts:346:12)
Cannot read properties of undefined (reading 'forEach')
Reproduction Steps
- Create lambda function, deploy stack
const func = new lambda.Function(this, "Function", {
code: lambda.Code.fromInline(`exports.handler = async () => {}`),
handler: "index.handler",
runtime: lambda.Runtime.NODEJS_16_X,
});
- Add tags, deploy stack
Tags.of(func).add("key", "value");
cdk deploy --hotswap
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.37.1
Framework Version
No response
Node.js Version
16.16.0
OS
Mac OS
Language
Typescript
Language Version
3.9.7
Other information
No response
skorfmann and webratz
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1package/toolsRelated to AWS CDK Tools or CLIRelated to AWS CDK Tools or CLI