# Runtime

Lambda function runtime environment.

If you need to use a runtime name that doesn't exist as a static member, you
can instantiate a `Runtime` object, e.g: `new Runtime('nodejs99.99')`.

For NodeJS lambda functions, it is recommended to use the latest LTS NodeJS runtime available
(`Runtime.NODEJS_LATEST`) to keep the lambda function up-to-date.

- Source: [`aws-lambda/lib/runtime.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts#L57)
- Type last changed: v2.263.0 · 31 Jul 2026

## Example

```ts
const myFunctionHandler = new lambda.Function(this, 'MyFunction', {
  code: lambda.Code.fromAsset('resource/myfunction'),
  runtime: lambda.Runtime.NODEJS_LATEST,
  handler: 'index.handler',
});

const eventRule = cloudtrail.Trail.onEvent(this, 'MyCloudWatchEvent', {
  target: new targets.LambdaFunction(myFunctionHandler),
});

eventRule.addEventPattern({
  account: ['123456789012'],
  source: ['aws.s3'],
});
```

## Initializer

```ts
new Runtime(name: string, family?: RuntimeFamily, props?: LambdaRuntimeProps)
```

## Properties

- `ALL`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html)[] (static) — A list of all known `Runtime`'s.

- `bundlingImage`: [DockerImage](/cdk/api/v2/docs/aws-cdk-lib.DockerImage.html) — The bundling Docker image for this runtime.

- `DOTNET_10`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The .NET 10 runtime (dotnet10).

- `DOTNET_6`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET runtime.

- `DOTNET_8`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The .NET 8 runtime (dotnet8).

- `DOTNET_9`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The .NET 9 runtime (dotnet9).

- `DOTNET_CORE_1`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.

- `DOTNET_CORE_2`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.

- `DOTNET_CORE_2_1`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.

- `DOTNET_CORE_3_1`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.

- `family`: [RuntimeFamily](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.RuntimeFamily.html) — The runtime family.

- `FROM_IMAGE`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — A special runtime entry to be used when function is using a docker image.

- `GO_1_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the PROVIDED_AL2023 runtime.

- `isVariable`: boolean — Enabled for runtime enums that always target the latest available.

- `JAVA_11`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Java 11 runtime (java11).

- `JAVA_11_AL2023`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Java 11 AL2023 runtime (java11.al2023).

- `JAVA_17`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Java 17 runtime (java17).

- `JAVA_17_AL2023`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Java 17 AL2023 runtime (java17.al2023).

- `JAVA_21`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Java 21 runtime (java21).

- `JAVA_25`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Java 25 runtime (java25).

- `JAVA_8`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Java runtime.

- `JAVA_8_AL2023`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Java 8 AL2023 runtime (java8.al2023).

- `JAVA_8_CORRETTO`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Java 8 Corretto runtime (java8.al2).

- `name`: string — The name of this runtime, as expected by the Lambda resource.

- `NODEJS`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_10_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_12_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_14_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_16_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_18_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_20_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The NodeJS 20.x runtime (nodejs20.x).

- `NODEJS_22_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The NodeJS 22.x runtime (nodejs22.x).

- `NODEJS_24_X`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The NodeJS 24.x runtime (nodejs24.x).

- `NODEJS_4_3`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_6_10`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_8_10`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

- `NODEJS_LATEST`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The latest NodeJS version currently available in ALL regions (not necessarily the latest NodeJS version available in YOUR region).

- `PROVIDED`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest provided.al2023 runtime.

- `PROVIDED_AL2`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The custom provided runtime with Amazon Linux 2 (provided.al2).

- `PROVIDED_AL2023`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The custom provided runtime with Amazon Linux 2023 (provided.al2023).

- `PYTHON_2_7`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.

- `PYTHON_3_10`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Python 3.10 runtime (python3.10).

- `PYTHON_3_11`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Python 3.11 runtime (python3.11).

- `PYTHON_3_12`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Python 3.12 runtime (python3.12).

- `PYTHON_3_13`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Python 3.13 runtime (python3.13).

- `PYTHON_3_14`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Python 3.14 runtime (python3.14).

- `PYTHON_3_6`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.

  The Python 3.6 runtime is deprecated as of July 2022.

- `PYTHON_3_7`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.

- `PYTHON_3_8`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.

- `PYTHON_3_9`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.

- `RUBY_2_5`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Ruby runtime.

- `RUBY_2_7`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Ruby runtime.

- `RUBY_3_2`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Ruby 3.2 runtime (ruby3.2).

- `RUBY_3_3`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Ruby 3.3 runtime (ruby3.3).

- `RUBY_3_4`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Ruby 3.4 runtime (ruby3.4).

- `RUBY_4_0`: [Runtime](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Runtime.html) (static) — The Ruby 4.0 runtime (ruby4.0).

- `supportsCodeGuruProfiling`: boolean — Whether this runtime is integrated with and supported for profiling using Amazon CodeGuru Profiler.

- `supportsInlineCode`: boolean — Whether the ``ZipFile`` (aka inline code) property can be used with this runtime.

- `supportsSnapStart`: boolean — Whether this runtime supports snapstart.

## Methods

- `determineLatestPythonRuntime(scope: Construct): Runtime // chainable` (static) — The latest Python version currently available.

- `runtimeEquals(other: Runtime): boolean`

- `toString(): string`
