(aws-s3-deployment): BucketDeployment unpacks zip-file generated in custom bundling #25879
Labels
@aws-cdk/aws-s3-deployment
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
effort/medium
Medium work item – several days of effort
p2
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
I want to create a zip file using the aws_s3_deployment.Source.asset() function and upload that zip file via aws_s3_deployment.BucketDeployment.
In the cdk.out folder everything looks fine --> the file "myzip.zip" is generated as expected.
But I'm not able to upload this zip file with the exact name to S3 via the BucketDeployment.
Expected Behavior
I would expect that if I use my own bundling mechanism and generate a "zip" file as a result, then CDK could wrap another zip file around my own one and if I set extract=true the outer zip file would be unpacked but my own remains.
Current Behavior
If I use the "extract = true" flag in the BucketDeployment to upload my zip file the content of "myzip.zip" is extracted. That's not what I want, because I need to know the exact name of the zip file.
If I use the "extract = false" flag not the "myzip.zip" is uploaded but the zip file from the cdk-assets bucket with generated name (for example: c259545a7f3489e3b532a02c1c0b40f9a4f17c0febdf4c8846998878f9b9a19f.zip)
My current workaround is to use not the ".zip" extension but something like ".zip.tmp". In this case the "zip.tmp" file is not extracted when extract = true.
Reproduction Steps
I use this code:
The Dockerfile in "lib/general" is basically the one that CDK uses for Python Lambda Functions:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.81.0
Framework Version
2.81.0
Node.js Version
18.12.1
OS
macOS 13.3.1
Language
Typescript
Language Version
TypeScript (5.0.4)
Other information
No response
The text was updated successfully, but these errors were encountered: