Hello,
I have previously been using the nodejs14.x version on my AWS react application. Today I tried to add user authentication and I got this problem when doing amplify push. Is there a straightforward way to update the version so I am compliant with nodejs20.x? I have tried updating the "runtime" property within the cloudformation template. But, when I push, it reverts to nodejs14.x. I have not been able to find a solution today but I may be overlooking the obvious. Thank you for any help.
"UserPoolClientLambda": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"ZipFile": "const response = require('cfn-response');\nconst aws = require('aws-sdk');\nconst identity = new aws.CognitoIdentityServiceProvider();\nexports.handler = (event, context, callback) => {\n if (event.RequestType == 'Delete') {\n response.send(event, context, response.SUCCESS, {});\n }\n if (event.RequestType == 'Update' || event.RequestType == 'Create') {\n const params = {\n ClientId: event.ResourceProperties.clientId,\n UserPoolId: event.ResourceProperties.userpoolId,\n };\n identity\n .describeUserPoolClient(params)\n .promise()\n .then(res => {\n response.send(event, context, response.SUCCESS, { appSecret: res.UserPoolClient.ClientSecret });\n })\n .catch(err => {\n response.send(event, context, response.FAILED, { err });\n });\n }\n};\n"
},
"Role": {
"Fn::GetAtt": [
"UserPoolClientRole",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs14.x",
"Timeout": 300
},
"DependsOn": [
"UserPoolClientRole"
]
},