question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How best to upgrade Lambda functions from Node 12 to Node 16?

See original GitHub issue

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

How did you install the Amplify CLI?

yarn

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

9.2.1

What operating system are you using?

Windows

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No. I’m trying to avoid making any when upgrading to Node 16 in all my Lambda’s. I’m worried any changes will just get over-written when I next deploy anyway hence asking here 😃

Amplify Categories

function

Amplify Commands

push

Describe the bug

Got an email this week reminding me that I’m still running some early functions on Node 12, this is going to be retired in November so I need to change the environment that they are running on to be Node 16.

I used this lovely little one line in a console to get a list of all the functions in question (taken from the email, thank you):

aws lambda list-functions --function-version ALL --region us-east-1 --output text --query "Functions[?Runtime=='nodejs12.x'].FunctionArn"

Obvs change the region to match the one you are using.

I found some older docs on how to do this upgrade from Node 8 to Node 10 (https://docs.amplify.aws/cli/migration/lambda-node-version-update/) but we don’t seem to have an updated version for Node 12 to Node 16. Is there going to be one? Could we get one created?

Expected behavior

The docs at https://docs.amplify.aws/cli/migration/lambda-node-version-update/ include a section on how to update from Node 12 to Node 16 in a manner that Amplify won’t over write any changes on the next deploy.

I could try to follow the Node 8 upgrade path but not sure if anything differs (its not something I do regularly).

Reproduction steps

Well, not sure really, have a Lambda setup to run with Node 12 and try to upgrade it?

GraphQL schema(s)

# Put schemas below this line


Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:13
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
josefaidtcommented, Aug 20, 2022

Note for fix: it would be nice to have a amplify migrate function command to auto-migrate runtimes without the need for a string replace in the function’s CloudFormation template

2reactions
pptavozlcommented, Sep 20, 2022

how do you manually change these lambda functions: “amplify-login-(verify/create/custom/define)-(ID)”? I don’t see any Cloudformation templates for them.

Directly in AWs Console panel.

Those functions stay although you deleted the amplify app, normally 4 for each amplify app are created. I mean i have 5 amplify apps created, and i updated 32 lambdas from 12.x to 16.x manually, but i can’t identify to wich app it belongs to

Add this filter in lambda to find them CleanShot 2022-09-20 at 09 13 01@2x

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I safely update my AWS Lambda functions' runtime ...
This snippet demonstrates settings for Node 16, uses the 'Graviton' processor (can be faster/cheaper), bumps the timeout a smidge, ...
Read more >
Node.js 16.x runtime now available in AWS Lambda
You can now develop AWS Lambda functions using the Node.js 16 runtime. This version is in active LTS status and considered ready for...
Read more >
I was upgrade my nodejs runtime from 12.x to 16.x but custom ...
How to upgrade this custom resource lambda? ... Try to upgrade to serverless version v3 as the default node version up to v3...
Read more >
AWS withdrawing Lambda support for Node.js 12 - Si Novi
Node.js 12 is being withdrawn as a supported runtime for AWS Lambda functions from 14th November 2022, so any Lambda functions currently using ......
Read more >
AWS Lambda Now Has Support for Node.js 16 Runtime - InfoQ
Developers can now author AWS Lambda functions using Node.js' new features, such as toolchain and compiler upgrades (including prebuilt ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found