Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'aws-sdk' in version 2.2.0. #206

Open
kadishmal opened this issue Apr 2, 2024 · 1 comment · Fixed by #207
Open

Error: Cannot find module 'aws-sdk' in version 2.2.0. #206

kadishmal opened this issue Apr 2, 2024 · 1 comment · Fixed by #207
Assignees
Labels
bug Something isn't working

Comments

@kadishmal
Copy link
Collaborator

kadishmal commented Apr 2, 2024

We have pushed a breaking change that throws the following error during deployment.

Received response status [FAILED] from custom resource. Message returned: Error: Cannot
find module 'aws-sdk'
Require stack:
- /var/task/index.js
- /var/task/__entrypoint__.js
- /var/runtime/index.mjs

The reason is that we have upgraded Node runtime in Lambda to v18, which drops AWS SDK v2 as a runtime dependency and instead includes v3.

Blast radius

Anybody who wants to upgrade to v2.2.0 will have their stack deployments rollback due to the above error. The existing deployment will not be affected.

Solutions

To mitigate the issue we have to either:

  1. Downgrade Node runtime to v16 from v18.
  2. Move aws-sdk to production dependencies section so that Lambda code includes the library, and remove from externals. ✅

The longterm solution is to migrated AWS SDK to v3. We will publish an intermediary release to mitigate the issue, then will push a longterm solution.

@kadishmal kadishmal self-assigned this Apr 2, 2024
@kadishmal kadishmal added the bug Something isn't working label Apr 2, 2024
@hupe1980 hupe1980 linked a pull request Apr 4, 2024 that will close this issue
@kadishmal
Copy link
Collaborator Author

Mitigated the issue by including the AWS SDK v2 into each Lambda bundle. Soon will migrate AWS SDK v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant