error while stepping this code in lambda function
{ "errorMessage": "Cannot find module '/var/task/index'", "errorType": "Error", "stackTrace": [ "Function.Module._load (module.js:417:25)", "Module.require (module.js:497:17)", "require (internal/module.js:20:19)" ] }
START RequestId: 27d215ba-37e8-11e8-9919-cb53bb33c493 Version: $LATEST Unable to import module 'index': Error at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) END RequestId: 27d215ba-37e8-11e8-9919-cb53bb33c493 REPORT RequestId: 27d215ba-37e8-11e8-9919-cb53bb33c493 Duration: 106.08 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 19 MB
Maybe you packaged it incorrectly, I had that too at first...
If you cloned it into lambda-rds-start-stop, proceed as:
- cd lambda-rds-start-stop
- npm install
- zip -r ../lambda-rds-start-stop *
and this will create the correct zip file in ../lambda-rds-start-stop.zip