aws-lambda-nodejs: Add support for bundling aws-sdk #28311
Labels
@aws-cdk/aws-lambda-nodejs
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p3
Describe the feature
NodejsFunction ESBuild by default excludes the aws sdk from the bundle. Excluding the aws sdk by default reduces the package size, but we observed this is adding additional time to load the aws sdk modules at the function runtime.
Sample function that uses aws sdk to read a dynamoDB table during the init phases takes 800ms if the aws sdk is excluded in the bundle and around 400ms if the aws sdk is bundled in the package.
Rightnow, the only option to include aws sdk in the bundle is to use NODEJS_LATEST as the runtome. I would like to request a feature to support an option to include aws sdk with any specific node runtime.
may be some option like
Use Case
This will reduce the time for the lambda run and thus improve latency and reduce the cost for the lambda function.
Proposed Solution
I would like to request a feature to support an option to include aws sdk with any specific node runtime.
may be some option like
Other Information
No response
Acknowledgements
CDK version used
2.96.0
Environment details (OS name and version, etc.)
macOS 13.6.2
The text was updated successfully, but these errors were encountered: