-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
@aws-cdk/coreRelated to core CDK functionalityRelated to core CDK functionalitybugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2
Description
Describe the bug
Cancelling cdk synth when a Lambda function is bundling can cause an empty bundling-temp-<hash> folder in cdk.out. This results in the next deployment of the Lambda to fail with InvalidParameterValueException: Uploaded file must be a non-empty zip.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
CDK does not use existing bundling-temp folder if it is empty.
Current Behavior
CDK uses existing empty bundling-temp folder for deployment.
Reproduction Steps
- Setup Amplify (Gen 2) https://docs.amplify.aws/react/start/manual-installation/
- Setup a function https://docs.amplify.aws/react/build-a-backend/functions/set-up-function/
- Run
npx ampx sandbox --debug Ctrl+Cright whenBundling asset <Lambda>/Code/Stage...appears- Notice empty
bundling-tempfolder incdk.out
- Run
npx ampx sandboxagain
Possible Solution
No response
Additional Information/Context
We are seeing this for Amplify customers but I believe this can happen using only CDK for example in #18459 (comment).
CDK CLI Version
2.176.0
Framework Version
No response
Node.js Version
22.13.1
OS
Linux/Mac/Windows (More frequently on Windows from what we've seen)
Language
TypeScript
Language Version
No response
Other information
No response
sobolk and Amplifiyer
Metadata
Metadata
Assignees
Labels
@aws-cdk/coreRelated to core CDK functionalityRelated to core CDK functionalitybugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2