Why is AWS no longer supporting Node.js version 12?
One of Lambda's most powerful features is that you just choose the runtime and major version and deploy your code - then AWS take care of all necessary updates, minor and patch versions. We don't need to maintain or monitor servers or patch server software, although using Lambda functions does mean monitoring in different ways.
Like all open-source software, Node.js has a release cycle with new versions being released and older versions deprecated periodically, to keep the library current and secure. Version 12 of Node.js reached end-of-life on April 30, 2022 - receiving no further updates or security patches - and so AWS are removing support for version 12 of Node.js in AWS Lambda and moving Lambda users up to newer versions of the runtime.
What is the schedule for AWS's withdrawal of Node.js 12 support?
AWS are deprecating Node.js 12 for AWS Lambda in two stages:
- Starting November 14, 2022, Lambda will no longer apply security patches and other updates to the Node.js 12 runtime used by Lambda functions, and functions using Node.js 12 will no longer be eligible for technical support. In addition, you will no longer be able to create new Lambda functions using the Node.js 12 runtime.
- Starting December 14, 2022, you will no longer be able to update existing functions using the Node.js 12 runtime.
Updating AWS Lambda functions from Node.js 12
Production applications should only use Active LTS or Maintenance LTS releases of Node.js, so while you could go up to Node.js 14, this version is already in maintenance long-term-support and only until 30th April 2023.
AWS added support for Node.js 16 in May 2022, and this is now the highest supported version of Node.js on AWS Lambda. As part of their Node.js 12 support notifications, AWS have advised to update Node.js 12 Lambda functions from to Node.js 16.
Unfortunately the lifecycle of Node.js 16 may be shorter than usual as the OpenJS Foundation have confirmed that they have brought forward the End-of-Life date for Node.js 16 by seven months.
Due to the end of support for OpenSSL 1.1.1 on September 11th 2023, Node.js 16 will also become end-of-Life on this date, which will undoubtedly also affect the AWS Lambda support schedule.
Our process for updating Lambda function runtime versions
Before updating our production Lambdas we'll follow a careful testing and deployment process. When moving from one major version to another there are a number of things to consider and steps to follow. The steps we'd work through would be something like this:
Local development: Provisioning our existing Lambda function code onto new runtimes locally, using Node Version Manager (nvm) to manage our local node version, and running the function code against the planned new version Node.js such as version 16.
Updating dependencies: Updating dependencies with Node Package Manager (npm) to ensure compatibility with the new Node.js version, then re-writing Lambda code and/or replacing incompatible dependencies.
Local testing: Writing and running tests and confirming expected behaviour between old and new versions of the functions and between the old Node.js 12 runtime and the latest 16.x runtime
Infrastructure-as-code updates: Updating our Cloudformation, SAM templates and custom deploy scripts to specify the new 16.x runtime for all Lambda functions
Deploying new Lambdas: Deploying the changes into our production environments and monitoring to ensure continued smooth operation