DEV Community

Cover image for The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions
Nick Triantafillou
Nick Triantafillou

Posted on

1

The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions

On the 25th of February, 2024, AWS made a change:

Starting January 25, 2024, you will no longer be able to update existing functions using the Node.js 14 runtime.

and if you attempt to do so, you hit this error:

InvalidParameterValueException: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions

But I'm not using nodejs14.x to create or update lambda functions.

Or am I?

I didn't think I was, my runtimes in AWS CodeBuild and Serverless Framework were all set to 16.. but I was using an extra component with serverless framework.. that component was https://www.npmjs.com/package/@sls-next/serverless-component

and internally somewhere.. this component uses lambda. And those Lambda functions were trying to be created with nodejs 14.

Thanks to an awesome comment I found on github I learned you can simply change your internal serverless-component runtime to nodejs20.x and it should fix your issues. It did for me.

blah:
  component: "@sls-next/serverless-component"
  stage: dev
  inputs:
    bucketName: ${env.AWS_S3_BUCKET}
    bucketRegion: ap-southeast-2
    cloudfront:
      distributionId: ${env.AWS_CFID}
    runtime:
      defaultLambda: 'nodejs20.x'
Enter fullscreen mode Exit fullscreen mode

Deploy, and the problem goes away.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay