Lambda runtimes - AWS Lambda

Lambda runtimes

Lambda supports multiple languages through the use of runtimes. For a function defined as a container image, you choose a runtime and the Linux distribution when you create the container image. To change the runtime, you create a new container image.

When you use a .zip file archive for the deployment package, you choose a runtime when you create the function. To change the runtime, you can update your function's configuration. The runtime is paired with one of the Amazon Linux distributions. The underlying execution environment provides additional libraries and environment variables that you can access from your function code.

Amazon Linux

Amazon Linux 2

  • Image – Custom

  • Linux kernel – 4.14.165-102.205.amzn2.x86_64

When your function is invoked, Lambda attempts to re-use the execution environment from a previous invocation if one is available. This saves time preparing the execution environment, and it allows you to save resources such as database connections and temporary files in the execution environment to avoid creating them every time your function runs.

A runtime can support a single version of a language, multiple versions of a language, or multiple languages. Runtimes specific to a language or framework version are deprecated when the version reaches end of life.

Node.js runtimes
Name Identifier AWS SDK for JavaScript Operating system

Node.js 12

nodejs12.x

2.771.0

Amazon Linux 2

Node.js 10

nodejs10.x

2.771.0

Amazon Linux 2

Python runtimes
Name Identifier AWS SDK for Python Operating system

Python 3.8

python3.8

boto3-1.15.16 botocore-1.18.16

Amazon Linux 2

Python 3.7

python3.7

boto3-1.15.16 botocore-1.18.16

Amazon Linux

Python 3.6

python3.6

boto3-1.15.16 botocore-1.18.16

Amazon Linux

Python 2.7

python2.7

boto3-1.15.16 botocore-1.18.16

Amazon Linux

Ruby runtimes
Name Identifier AWS SDK for Ruby Operating system

Ruby 2.7

ruby2.7

3.0.1

Amazon Linux 2

Ruby 2.5

ruby2.5

3.0.1

Amazon Linux

Java runtimes
Name Identifier JDK Operating system

Java 11

java11

amazon-corretto-11

Amazon Linux 2

Java 8

java8.al2

amazon-corretto-8

Amazon Linux 2

Java 8

java8

java-1.8.0-openjdk

Amazon Linux

Go runtimes
Name Identifier Operating system

Go 1.x

go1.x

Amazon Linux

.NET runtimes
Name Identifier Operating system

.NET Core 3.1

dotnetcore3.1

Amazon Linux 2

.NET Core 2.1

dotnetcore2.1

Amazon Linux

To use other languages in Lambda, you can implement a custom runtime. The Lambda execution environment provides a runtime interface for getting invocation events and sending responses. You can deploy a custom runtime alongside your function code, or in a layer.

Custom runtime
Name Identifier Operating system

Custom Runtime

provided.al2

Amazon Linux 2

Custom Runtime

provided

Amazon Linux