-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
aws_s3_deployment.BucketDeployment: deploying a simple zip-file is not possible #30971
Comments
@gratinierer Good morning. Thanks for opening the issue. If your scenario is to just upload simple
In your case, you could use object_keys on the Kindly note that CDK is not an AWS SDK (which allows to upload and invoke S3 operations). It allows you to define infrastructure as a code and allows to deploy the stack via CloudFormation. Thanks, |
Hi @ashishdhingra,
That‘s the point. i found a simple, but not beautiful workaround: i zip my zip file a second time, than do the s3 deployment. In that case i get my zip-file with the correct name to the bucket. but i still think, that this woraround should no be needed, if the cdk would always follow the same flow, no matter if you pass a zip file or another payload. |
@gratinierer The default behavior to unzip the Upon checking documentation again, I noticed that the DeployTimeSubstitutedFile construct provides the same custom resource workaround as I proposed in #30971 (comment). The following code will upload the named zip file with the specified destination key in an S3 bucket: new s3deploy.DeployTimeSubstitutedFile(this, 'MyZipFile', {
source: path.join(__dirname, '../testbucket-someissue-deployment.zip'),
destinationKey: 'testbucket-someissue-deployment.zip',
destinationBucket: s3.Bucket.fromBucketName(this, 'testbucket', 'testbucket-someissue'),
substitutions: {}
}); I tested it locally and notice the file named Thanks, |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Hi @ashishdhingra , |
@gratinierer Good morning. I think you are correct. Looks like The possible workaround in this case is to use custom resource along with |
Describe the bug
Try to push a simple zip-file to S3
Expected Behavior
deployment_bucket
contains one file namedaZipFile.zip
after deploymentCurrent Behavior
the content gets extracted during deployment, so you don't get a zip-file but the extracted content.
setting
extract
toFalse
does also not have the desired effect, because the you get a zip file but with a random-uuid-name and notaZipFile.zip
.Reproduction Steps
see above
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.148.0 (build e5740c0)
Framework Version
No response
Node.js Version
20.15
OS
Linux
Language
Python
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: