1

I have tried to import mongodb into my lambda function and I keep getting an error message when I attempt to test it. All the recommended resolutions I have seen assume I am working in an environment where I can just add a package.json to my root directory, without telling me where the root directory is!

I have tried resolution recommendations I have seen in Diagnose with Amazon Q. I have tried everything I have come across on google AI. I have attempted to create an instance, which I was successfully able to install mongodb, which didn't resolve anything!

3
  • Did you use environment variables for the connection string ? where is your mongodb server ? Commented Oct 8 at 13:52
  • This question is similar to: How to load npm modules in AWS Lambda?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Oct 9 at 12:21
  • I figured it out. The Download option is not under the Actions button, but rather a separate button on the Function Overview Page. From there, I was able to use PowerShell to run the npm install on my local machine and upload it back. Commented Oct 9 at 14:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.