(CLI): Building & Publishing of assets happen even when there are no changes to them (aws-lambda-nodejs)
- Dominant language
- TypeScript
- Stars
- 105
- Forks
- 122
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 71
Description
### Describe the bug
I've added custom mechanism to ensure we do not have to `esbuild` assets each time when there are no code changes. But on CLI level these assets are build and published anyways. I don't see any possibility to change that.
Building happens here: https://github.com/aws/aws-cdk/blob/34c7b9e7d882cd76a2b2f513781f9202385f4d30/packages/aws-cdk/lib/cdk-toolkit.ts#L175
Publishing: https://github.com/aws/aws-cdk/blob/34c7b9e7d882cd76a2b2f513781f9202385f4d30/packages/aws-cdk/lib/api/cloudformation-deployments.ts#L402 (it seems).
I've looked also into `--exclude-build`, but it seems it is not used with `aws-lambda-nodejs`...
### Expected Behavior
Do not build & publish assets, which haven't changed.
### Current Behavior
Assets are being build and published.
### Reproduction Steps
Use `aws-lambda-nodejs` and deploy stack with Lambda(s).
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.43.0
### Framework Version
_No response_
### Node.js Version
16.13.0
### OS
MacOS 12.2.1
### Language
Typescript
### Language Version
TypeScript (4.7.4)
### Other information
_No response_
Contributor guide
Research direction
Start in packages/aws-cdk/lib/cdk-toolkit.ts around line 175 and packages/aws-cdk/lib/api/cloudformation-deployments.ts around line 402, then trace how --exclude-build is handled for aws-lambda-nodejs. Reproduce a deployment with unchanged Lambda assets and verify that unchanged assets are neither built nor published.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100