simple node.js example in aws lambda

All working now, I had to increase the Timeout(s) seconds in advanced settings, as it was taking longer than 3 seconds.

Also I had to ensure my node modules were correctly installed. I had messed up the request module when trying to figure out what was wrong.

To reinstall the module, I deleted then re-installed request.

  • deleted node_modules
  • npm init
  • added the dependancies "request" : "*" in the package.json,
  • npm install. Compressed the zip and uploaded, all working now. :)

You have to zip and upload subfolders only, not a root folder. You have to zip following folders as per your example, then upload:

|-- index.js
|-- node_modules
    |-- request