Replies: 1 comment
-
The example in the repo is well written but the concrete example is with CDK. If anyone wants an example using the SDK and CLI upvote this comment and I'll add an in-depth explanation on how to do that. Thanks, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There is a lack of ES Modules support in Lambda Node 14 and 16, it affects all dependencies, not just the AWS SDK.
This is a limitation of Lambda, and is unrelated to the SDK and it is documented.
There are currently 3 workarounds:
☝️ This is the recommended workaround.
We are formalizing our plans to make the Maintenance Announcement (Phase 2) for AWS SDK for JavaScript v2 in 2023. For more info refer to our Maintenance Policy.
Additinally, Node 14 is already not in LTS, and Node 16 is scheduled for end of LTS during 2023.
With the Lambda Node 14 or Node 16 runtimes, you can deploy your own copy of the SDK v2 instead of using the SDK bundled with the runtime. This can be done by bundling the application, or providing the SDK in Lambda layer, or uploading your node_modules. By doing so, this places the SDK in a supported path, and you will then be able to import the SDK as an ES module.
Create a symlink to get the included SDK from the opt folder in Lambda. I have tested this solution myself, and verified that it's working.
(not recommended)
Beta Was this translation helpful? Give feedback.
All reactions