As we all know, AWS have done a good job at informing us that the NodeJS 8.10 EOL is approaching. However, there is limited information on how to update the runtime if we have been using AWS Amplify and the Lambda functions have been automatically created using the Amplify CLI.
I have an autogenerated lambda function, "add-to-group", that is triggered on post confirmation during sign up in my React app.
I have tried opening the Lambda function in the Lambda Function console and changing the runtime in the dropdown box that sits above the code editor. However, when invoking this lambda by signing up in my app, I get the following error returned to the client:
"code":"UserLambdaValidationException","name":"UserLambdaValidationException","message":"PostConfirmation failed with error Cannot find module 'add-to-group'\nRequire stack:\n- /var/task/index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js."
How do you update the runtime of a lambda function that was generated by AWS amplify?
Thanks!
Instructions for migrating from Node.js v8 to v10 are documented at Node Version Update.
Amplify doesn't control the runtime; you do, through configuration.