gulp deploy fails on lambda creation - repo needs to be updated for supported nodejs version
[2019-01-16T04:41:55.903Z] INFO: spacefinder/20 on 1f1dc08d454a: Creating Lambd a functions from Swagger API definition...
[2019-01-16T04:41:56.299Z] ERROR: spacefinder/20 on 1f1dc08d454a:
step failed { InvalidParameterValueException: The runtime parameter of nodej s4.3 is no longer supported for creating or updating AWS Lambda functions. We re commend you use the new runtime (nodejs8.10) while creating or updating function s.
at Object.extractError (/home/aws-serverless-auth-reference-app/api/node modules/aws-sdk/lib/protocol/json.js:48:27)
at Request.extractError (/home/aws-serverless-auth-reference-app/api/nod e_modules/aws-sdk/lib/protocol/rest_json.js:45:8)
at Request.callListeners (/home/aws-serverless-auth-reference-app/api/no de_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/home/aws-serverless-auth-reference-app/api/node_module s/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/home/aws-serverless-auth-reference-app/api/node_module s/aws-sdk/lib/request.js:683:14)
at Request.transition (/home/aws-serverless-auth-reference-app/api/node modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/home/aws-serverless-auth-reference-app/a pi/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /home/aws-serverless-auth-reference-app/api/node_modules/aws-sdk/lib/ state_machine.js:26:10
at Request.
Thanks for reporting this issue. I am working on a v2 of this project including the latest frameworks and runtimes, which should be available in the next few weeks.
For the nodejs new comers, like myself, here's how to overcome this issue:
- edit the file: aws-serverless-auth-reference-app/api/util/lambda.js
- replace "Runtime: 'nodejs4.3'" by "Runtime: 'nodejs6.10'" You can make this change within Docker by installing vim:
apt-get update apt-get install vim vi aws-serverless-auth-reference-app/api/util/lambda.js
A word of appreciation to Jim Tran, Justin Pirtle et al, for this project's initiative. Thanks guys!
For people who are following along at home, you now have to
replace "Runtime: 'nodejs4.3'" by "Runtime: 'nodejs10.x'" (Or possibly 'nodejs8.1')