aws-amplify / aws-amplify/amplify-cli

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

Open
#10,894 18 comments 17 reactions 0 assignees View on GitHub
feature-request functions p3
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] 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)

```graphql
# Put schemas below this line

```

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the migration guide at docs.amplify.aws/cli/migration/lambda-node-version-update/ and compare its Node 8-to-10 procedure with the Node 12-to-16 Lambda runtime change. Document a supported upgrade path that Amplify will not overwrite on the next push, and verify it against the AWS Lambda functions described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, node.js
Domain
cli, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.