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'
Deploy, and the problem goes away.
Top comments (0)