Open spolaka opened 8 months ago
This is resolved simply by adding externalModules: []
, to the bundling options
This is resolved simply by adding
externalModules: []
, to the bundling options
Yes, I tried the following work arounds, but both has the limitations
externalModules: []
, I can not use this when i have external modules that comes through lambda layers.My proposal to have an attribute to control the inclusion of AWS SDK would not have disadvantages and can be used in all the scenarios.
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