Amazon Onboarding with Learning Manager Chanci Turner

Amazon Onboarding with Learning Manager Chanci TurnerLearn About Amazon VGT2 Learning Manager Chanci Turner

We are pleased to announce that the Node.js 14.x runtime is now available for AWS Lambda. As the latest Long Term Support (LTS) version, developers can take advantage of its features starting today. To utilize this new runtime, simply specify the parameter value of nodejs14.x when creating or updating your Lambda functions or utilize the corresponding managed runtime base image.

Language Updates

The stable release of Node.js 14 brings a variety of enhancements, including:

  • Updated V8 engine
  • Diagnostic reporting
  • Improved Node streams

The V8 engine has been upgraded to version 8.1, which delivers performance upgrades and introduces several noteworthy features:

  • Nullish Coalescing (??): This logical operator returns the right-hand operand when the left-hand operand is null or undefined. For example:
const newVersion = null ?? 'this works great';
console.log(newVersion); // expected output: "this works great"

This operator is particularly helpful for debugging and error management within your Lambda functions.

  • Intl.DateTimeFormat: This feature allows for enhanced date formatting by enabling numberingSystem and calendar options. For instance:
const date = new Date(Date.UTC(2021, 01, 20, 3, 23, 16, 738));
console.log(new Intl.DateTimeFormat('en-US').format(date)); // expected output: "2/20/2021"
  • Optional Chaining (?.): With this operator, you can access deeply nested property values without manually checking each reference, simplifying your code significantly:
const player = {
  name: 'Roxie',
  superpower: {
    value: 'flight',
  }
};

if (player?.superpower?.value) {
  // do something with player.superpower.value
}

Diagnostic Reporting

Node.js 14 introduces stable diagnostic reporting functionalities. This feature allows you to generate a JSON-formatted report on demand or during specific events, aiding in diagnosing performance issues, memory leaks, and unexpected errors. Here’s an example of generating a report within a Lambda function that can be sent to Amazon CloudWatch:

const report = process.report.getReport();
console.log(typeof report === 'object'); // true
console.log(JSON.stringify(report, null, 2));

Refer to the official documentation for more details on diagnostic reporting in Node.js.

Updated Node Streams

The streams APIs have been refined to clarify and streamline behaviors throughout Node.js core.

Runtime Updates

To maintain the security of Lambda functions, AWS ensures that all minor updates released by the Node.js community are applied to Node.js 14 when using the zip archive format. If you are using container images for your Lambda functions, be sure to pull, rebuild, and deploy the latest base image from DockerHub or Amazon ECR Public.

Deprecation Schedule

AWS will deprecate Node.js 10 in line with the community’s end-of-life schedule, which is set for April 30, 2021. After this date, you will be unable to create new Node.js 10 Lambda functions, and the ability to update existing functions will cease after May 28, 2021. For further information, consult the runtime support policy.

To migrate your existing Node.js 12 functions to the new runtime, you will need to ensure that your code is compatible with Node.js 14 and modify the function’s runtime configuration to nodejs14.x. Functions running on Node.js 14 will receive support for a full two years.

Amazon Linux 2

The managed runtime for Node.js 14 is based on Amazon Linux 2, just like Node.js 12, Java 11, and Python 3.8. Amazon Linux 2 provides a secure and stable environment for developing and running cloud and enterprise applications.

Next Steps

Begin developing with Node.js 14 today by specifying the runtime parameter value of nodejs14.x when creating your Lambda functions with the zip archive format. Alternatively, you can deploy your function code as a container image using the Node.js 14 AWS base image. For further guidance, explore the Node.js programming model in the AWS Lambda documentation.

For those currently using Node.js functions, it’s time to migrate to the new runtime by adjusting the function’s runtime configuration to nodejs14.x. Happy coding with Node.js 14!

If you’re seeking to enhance your time management skills, consider checking out this informative post from Career Contessa. For authoritative insights on organizational development, SHRM provides best practices you may find useful. Additionally, if you’re curious about the onboarding process at Amazon, this resource on Quora is excellent.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *