Home

Awesome

Node.js 10.x and 12.x for AWS Lambda

A custom runtime for AWS Lambda to execute functions in Node.js 10.x or 12.x

Getting Started

Save as index.js:

exports.handler = async(event, context) => {
  console.log(`Hi from Node.js ${process.version} on Lambda!`)
  console.log(`There is ${context.getRemainingTimeInMillis()}ms remaining`)
  return event
}

Then bundle up into a zipfile – this is your function bundle:

zip -yr lambda.zip index.js  # add node_modules too if you have any

Create a new Lambda function and choose the custom runtime option.

Create lambda

Select your lambda.zip as the "Function code" and make the handler "index.handler".

Function code

Then click on Layers and choose "Add a layer", and "Provide a layer version ARN" and enter the following ARN:

arn:aws:lambda:us-east-1:553035198032:layer:nodejs12:41

Or use this link and pick your function from the "Function name" auto-suggest.

Add a layer

Then save your lambda and test it with a test event!

Test event output

Current Version ARNs

Node.js versionARN
10.24.1arn:aws:lambda:<region>:553035198032:layer:nodejs10:31
12.22.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:41

Previous Version ARNs

Node.js versionARN
10.24.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:30
12.21.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:40
12.20.2arn:aws:lambda:<region>:553035198032:layer:nodejs12:39
10.23.3arn:aws:lambda:<region>:553035198032:layer:nodejs10:29
12.20.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:38
10.23.1arn:aws:lambda:<region>:553035198032:layer:nodejs10:28
12.20.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:37
10.23.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:27
12.19.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:36
12.19.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:35
10.22.1arn:aws:lambda:<region>:553035198032:layer:nodejs10:26
12.18.4arn:aws:lambda:<region>:553035198032:layer:nodejs12:34
10.22.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:25
12.18.3arn:aws:lambda:<region>:553035198032:layer:nodejs12:33
12.18.2arn:aws:lambda:<region>:553035198032:layer:nodejs12:32
10.21.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:24
12.18.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:31
12.18.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:30
10.20.1arn:aws:lambda:<region>:553035198032:layer:nodejs10:23
12.17.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:29
12.16.3arn:aws:lambda:<region>:553035198032:layer:nodejs12:28
12.16.2arn:aws:lambda:<region>:553035198032:layer:nodejs12:26
10.20.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:22
12.16.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:25
10.19.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:21
12.16.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:24
12.15.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:23
10.18.1arn:aws:lambda:<region>:553035198032:layer:nodejs10:20
12.14.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:22
10.18.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:19
12.14.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:21
10.17.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:18
12.13.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:20
12.13.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:19
10.16.3arn:aws:lambda:<region>:553035198032:layer:nodejs10:17
12.12.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:18
12.11.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:17
12.11.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:16
12.10.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:15
12.9.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:14
12.9.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:13
12.8.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:12
10.16.2arn:aws:lambda:<region>:553035198032:layer:nodejs10:16
12.8.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:11
12.7.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:10
10.16.1arn:aws:lambda:<region>:553035198032:layer:nodejs10:15
10.16.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:14
12.6.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:9
12.5.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:8
12.4.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:7
12.3.1arn:aws:lambda:<region>:553035198032:layer:nodejs12:6
10.15.3arn:aws:lambda:<region>:553035198032:layer:nodejs10:13
12.3.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:5
12.2.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:4
12.1.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:2
12.0.0arn:aws:lambda:<region>:553035198032:layer:nodejs12:1
11.14.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:17
11.13.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:16
11.12.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:13
11.11.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:11
11.10.1arn:aws:lambda:<region>:553035198032:layer:nodejs11:10
10.15.2arn:aws:lambda:<region>:553035198032:layer:nodejs10:7
10.15.1arn:aws:lambda:<region>:553035198032:layer:nodejs10:6
11.10.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:9
11.9.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:8
11.8.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:7
10.15.0arn:aws:lambda:<region>:553035198032:layer:nodejs10:5
11.7.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:6
11.6.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:5
10.14.2arn:aws:lambda:<region>:553035198032:layer:nodejs10:3
11.4.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:4
10.14.1arn:aws:lambda:<region>:553035198032:layer:nodejs10:1
11.3.0arn:aws:lambda:<region>:553035198032:layer:nodejs11:1

Things to be aware of