aws rekognition custom labels

0

Hi Everyone,

I'm trying to create a Rekognition Custom Labels Cloudstack using a template provided by AWS Media2Cloud but I keep encountering an error regarding CustomResourceLambda's node version (required version is 20, they only have 14 so it's extremely outdated). I'm using the Github repo link they provide which directs me to the AWS console to initialize the template's build so I'm not sure why the error is advising that I use an upgraded version of node when I'm not in control of this (AWS manages these templates).

I also tried generating the cloudstack via cli but I got the same error when I looked in the console to check the progress (it was rolled back). I tried updating the node version directly on the files but that just lead to a whole host of issues. It seems as though AWS doesn't regularly update these product templates so if someone could advise or maybe provide an updated template I'd appreciate it.

Thanks,

Nick

GitHub repo: https://github.com/aws-samples/amazon-rekognition-custom-brand-detection

TemplateURL: https://mediaent-solution-us-east-2.s3.amazonaws.com/custom-brand-detection/latest/amazon-rekognition-custom-brand-detection.template

Error message: "Resource handler returned message: "The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: 581ca9c3-f0ef-44f5-9cb5-30b2acb63668)" (RequestToken: 66f502c4-aeea-8422-b0b6-207366b93918, HandlerErrorCode: InvalidRequest)"

1 Answer
1
Accepted Answer

The error message you are receiving indicates that the Node.js 14.x runtime is no longer supported for Lambda functions. AWS recommends using the newer Node.js 20.x runtime instead.

To resolve this issue:

  • Update your Lambda function configuration to use the Node.js 20.x runtime instead of Node.js 14.x. You can do this by editing the function properties in the AWS Lambda console or AWS CLI/SDK.
  • Ensure any dependencies like the AWS SDK for JavaScript are compatible with Node.js 20.x. The version of the SDK included in the Lambda runtime has been updated from v2 to v3 starting with Node.js 18.x.
  • If your code is using features that are not supported in Node.js 20.x, you may need to update the code as well.
  • You can also create a Lambda layer containing custom dependencies instead of relying on what is included in the runtime. This gives you more control over versions.
profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed a month ago
  • Hi Giovanni, Thanks for responding. Yeah I updated my node version to 20 and also modified my files within the directory via npx aws-sdk-js-codemod@latest -t v2-to-v3/Users/nicholasortiz/amazon-rekognition-custom-brand-detection/deployment

    and I also rebuilt and deployed the stack but now the stack won't create because of ROLLBACK FAILED The following resource(s) failed to delete: [PrivateWorkforceConfiguration]

  • The root cause of this is Received response status [FAILED] from custom resource. Message returned: Cannot find module 'aws-sdk' Require stack: - /var/task/lib/sagemaker/privateWorkforce.js - /var/task/lib/sagemaker/index.js - /var/task/index.js - /var/runtime/index.mjs. I can't manually delete the stack because I get the same error and I'm not sure how to move forward at this point. It seems as though I'm in an endless cycle. Very frustrating to say the least.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions