Cancelling bundling of Lambda function causes next deployment to fail #33201
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
Describe the bug
Cancelling
cdk synth
when a Lambda function is bundling can cause an emptybundling-temp-<hash>
folder incdk.out
. This results in the next deployment of the Lambda to fail withInvalidParameterValueException: Uploaded file must be a non-empty zip
.Regression Issue
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
npx ampx sandbox --debug
Ctrl+C
right whenBundling asset <Lambda>/Code/Stage...
appearsbundling-temp
folder incdk.out
npx ampx sandbox
againPossible 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
The text was updated successfully, but these errors were encountered: