aws / aws/aws-cdk-cli

(aws-cdk): hotswap requires assetMetadata

Open
#227 1 comment 0 reactions 0 assignees View on GitHub
bug p2
Dominant language
TypeScript
Stars
105
Forks
122
Avg merge
1d 17h
Merged PRs (30d)
71

Description

### Describe the issue

It would be useful to document that the hotswap feature relies on the presence of asset metadata and will fail if `"assetMetadata": false,` is present in `cdk.json`.

Relevant code check: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/nested-stack-helpers.ts#L124

Example error:
```
MyStack-personal (dev-xxx-MyStack): deploying... [1/1]
[0%] start: Publishing xxxxxxxx:current
[100%] success: Published xxxxxx:current

❌ MyStack-personal (dev-xxx-MyStack) failed: TypeError: Cannot read properties of undefined (reading 'physicalName')
at findNestedHotswappableChanges (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:445:20423)
at classifyResourceChanges (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:445:17863)
at tryHotswapDeployment (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:445:16718)
at async deployStack (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:451:605)
at async Object.deployStack2 [as deployStack] (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:454:199716)
at async /Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:454:181438

❌ Deployment failed: TypeError: Cannot read properties of undefined (reading 'physicalName')
at findNestedHotswappableChanges (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:445:20423)
at classifyResourceChanges (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:445:17863)
at tryHotswapDeployment (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:445:16718)
at async deployStack (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:451:605)
at async Object.deployStack2 [as deployStack] (/Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:454:199716)
at async /Users/my-login/projects/MyProject/src/MyProjectCDK/node_modules/aws-cdk/lib/index.js:454:181438

```

### Links

https://github.com/aws/aws-cdk/blob/v1-main/packages/aws-cdk/README.md#hotswap-deployments-for-faster-development

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.