aws-samples/aws-cdk-intro-workshop

NODEJS_14_X is deprecated and causes an error on cdk deploy

Opened this issue · 2 comments

Describe the bug

NODEJS_14_X is deprecated and causes an error on cdk deploy. This version is no longer supported by AWS, therefore the version should be upgraded to at least NODEJS_16.

Expected Behavior

Successful cdk deploy

Current Behavior

"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.

Reproduction Steps

line 24 of hitcounter.ts runtime: lambda.Runtime.NODEJS_14_X,
When running cdk deploy the error for unsupported runtime in AWS Lambda functions is received.

Possible Solution

Replace:
runtime: lambda.Runtime.NODEJS_14_X,
with:
runtime: lambda.Runtime.NODEJS_16_X,

Additional Information/Context

No response

CDK CLI Version

No response

Section

No response

Browser

No response

Language

No response

@GryphonInfoSec Thanks for reporting the issue. I do recognize that Node 14.x is deprecated and we should fix the code example to change it to Node 16.x (at least). Thanks for the PR. Could you update your you PR to make similar change for Japanese version here.

Thanks,
Ashish

The NODEJS_16_X is also deprecated as of Jun 12, 2024 and function create will be blocked on Feb 28, 2025.
Lambda Supported Runtimes https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

It should be updated to NODEJS_20_X, which was made available on Nov 15, 2023