custom-resource-handlers: buffered asset download #29898
Labels
@aws-cdk/aws-s3
Related to Amazon S3
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
This issue is part feature request, part bug report.
S3 custom resource should be able to handle arbitrarily large asset files efficiently
Use Case
Deploying large asset files with an S3 custom resource causes the deployment Lambda to run out of memory The function's memory can be increased to compensate for bigger file sizes, but only up to a point and at additional costs.
Proposed Solution
It doesn't seem like the AWS CLI
s3
commands support buffered download. As proposed in #29862 (comment), using boto3'smultipart_threshold
should allow the file to be downloaded and written to disk in multiple parts.There might be other places where this change would be necessary, but this is the one that caused the initial issue:
aws-cdk/packages/@aws-cdk/custom-resource-handlers/lib/aws-s3-deployment/bucket-deployment-handler/index.py
Lines 171 to 180 in cfd336e
Other Information
See #29862 for the original issue
Acknowledgements
CDK version used
2.134.0
Environment details (OS name and version, etc.)
N/A
The text was updated successfully, but these errors were encountered: