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

AWS SDK v2 is no longer included in Node 18+ runtime, upgrade to v3 is required #83

Open
arpadgabor opened this issue Jan 17, 2024 · 2 comments · May be fixed by #84
Open

AWS SDK v2 is no longer included in Node 18+ runtime, upgrade to v3 is required #83

arpadgabor opened this issue Jan 17, 2024 · 2 comments · May be fixed by #84

Comments

@arpadgabor
Copy link

As you are probably aware, AWS SDK v2 is not included in the latest Node runtimes. From what I see, the lambda code is still using the v2 version instead of v3, and the custom resource fails to run with the following error:

{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module 'aws-sdk/clients/route53'\nRequire stack:\n- /var/task/verifier.js\n- /var/task/handlers/create.js\n- /var/task/handlers/index.js\n- /var/task/index.js\n- /var/runtime/index.mjs",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module 'aws-sdk/clients/route53'",
        "Require stack:",
        "- /var/task/verifier.js",
        "- /var/task/handlers/create.js",
        "- /var/task/handlers/index.js",
        "- /var/task/index.js",
        "- /var/runtime/index.mjs",
        "    at _loadUserApp (file:///var/runtime/index.mjs:1087:17)",
        "    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)",
        "    at async start (file:///var/runtime/index.mjs:1282:23)",
        "    at async file:///var/runtime/index.mjs:1288:1"
    ]
}

As there currently is no way to deploy the construct in the current state, I think a short-term fix would be to provide a 2.1.1 release with Node 16 runtime (as it's still supported until June). A longer-term and simple option would be to bundle the v2 SDK. Finally, the harder option would be a complete upgrade.

I'll see if I can get a PR started for the upgrade.

@arpadgabor arpadgabor linked a pull request Jan 17, 2024 that will close this issue
@mooyoul
Copy link
Owner

mooyoul commented Jan 17, 2024

Ahhh I missed that. I think just moving aws-sdk v1 from dev dep to dep would be quick fix. I know that aws sdk v1 is now deprecated but repairing handler to work is much important than refactoring code to use aws sdk v2 IMO.

So my plan would be like:

  1. Bundle aws-sdk v1 then release with patch version bump
  2. Refactor code to use aws-sdk v2 then release with minor version bump

It would be so appreiciated if you can submit for 1 for now :)

@arpadgabor
Copy link
Author

Created a PR for bundling: #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants