aws-cdk-lib.aws_lambda.Runtime

class Runtime

LanguageType name
.NETAmazon.CDK.AWS.Lambda.Runtime
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambda#Runtime
Javasoftware.amazon.awscdk.services.lambda.Runtime
Pythonaws_cdk.aws_lambda.Runtime
TypeScript (source)aws-cdk-lib » aws_lambda » 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').

Example

import * as signer from 'aws-cdk-lib/aws-signer';

const signingProfile = new signer.SigningProfile(this, 'SigningProfile', {
  platform: signer.Platform.AWS_LAMBDA_SHA384_ECDSA,
});

const codeSigningConfig = new lambda.CodeSigningConfig(this, 'CodeSigningConfig', {
  signingProfiles: [signingProfile],
});

new lambda.Function(this, 'Function', {
  codeSigningConfig,
  runtime: lambda.Runtime.NODEJS_18_X,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
});

Initializer

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

Parameters

  • name string
  • family RuntimeFamily
  • props LambdaRuntimeProps

Properties

NameTypeDescription
bundlingImageDockerImageThe bundling Docker image for this runtime.
namestringThe name of this runtime, as expected by the Lambda resource.
supportsCodeGuruProfilingbooleanWhether this runtime is integrated with and supported for profiling using Amazon CodeGuru Profiler.
supportsInlineCodebooleanWhether the ZipFile (aka inline code) property can be used with this runtime.
family?RuntimeFamilyThe runtime family.
static ALLRuntime[]A list of all known Runtime's.
static DOTNET_6RuntimeThe .NET 6 runtime (dotnet6).
static DOTNET_CORE_1⚠️RuntimeThe .NET Core 1.0 runtime (dotnetcore1.0).
static DOTNET_CORE_2⚠️RuntimeThe .NET Core 2.0 runtime (dotnetcore2.0).
static DOTNET_CORE_2_1⚠️RuntimeThe .NET Core 2.1 runtime (dotnetcore2.1).
static DOTNET_CORE_3_1⚠️RuntimeThe .NET Core 3.1 runtime (dotnetcore3.1).
static FROM_IMAGERuntimeA special runtime entry to be used when function is using a docker image.
static GO_1_XRuntimeThe Go 1.x runtime (go1.x).
static JAVA_11RuntimeThe Java 11 runtime (java11).
static JAVA_17RuntimeThe Java 17 runtime (java17).
static JAVA_8RuntimeThe Java 8 runtime (java8).
static JAVA_8_CORRETTORuntimeThe Java 8 Corretto runtime (java8.al2).
static NODEJS⚠️RuntimeThe NodeJS runtime (nodejs).
static NODEJS_10_X⚠️RuntimeThe NodeJS 10.x runtime (nodejs10.x).
static NODEJS_12_X⚠️RuntimeThe NodeJS 12.x runtime (nodejs12.x).
static NODEJS_14_XRuntimeThe NodeJS 14.x runtime (nodejs14.x).
static NODEJS_16_XRuntimeThe NodeJS 16.x runtime (nodejs16.x).
static NODEJS_18_XRuntimeThe NodeJS 18.x runtime (nodejs18.x).
static NODEJS_4_3⚠️RuntimeThe NodeJS 4.3 runtime (nodejs4.3).
static NODEJS_6_10⚠️RuntimeThe NodeJS 6.10 runtime (nodejs6.10).
static NODEJS_8_10⚠️RuntimeThe NodeJS 8.10 runtime (nodejs8.10).
static PROVIDEDRuntimeThe custom provided runtime (provided).
static PROVIDED_AL2RuntimeThe custom provided runtime (provided).
static PYTHON_2_7⚠️RuntimeThe Python 2.7 runtime (python2.7).
static PYTHON_3_10RuntimeThe Python 3.10 runtime (python3.10).
static PYTHON_3_6⚠️RuntimeThe Python 3.6 runtime (python3.6) (not recommended).
static PYTHON_3_7RuntimeThe Python 3.7 runtime (python3.7).
static PYTHON_3_8RuntimeThe Python 3.8 runtime (python3.8).
static PYTHON_3_9RuntimeThe Python 3.9 runtime (python3.9).
static RUBY_2_5⚠️RuntimeThe Ruby 2.5 runtime (ruby2.5).
static RUBY_2_7RuntimeThe Ruby 2.7 runtime (ruby2.7).
static RUBY_3_2RuntimeThe Ruby 3.2 runtime (ruby3.2).

bundlingImage

Type: DockerImage

The bundling Docker image for this runtime.


name

Type: string

The name of this runtime, as expected by the Lambda resource.


supportsCodeGuruProfiling

Type: boolean

Whether this runtime is integrated with and supported for profiling using Amazon CodeGuru Profiler.


supportsInlineCode

Type: boolean

Whether the ZipFile (aka inline code) property can be used with this runtime.


family?

Type: RuntimeFamily (optional)

The runtime family.


static ALL

Type: Runtime[]

A list of all known Runtime's.


static DOTNET_6

Type: Runtime

The .NET 6 runtime (dotnet6).


static DOTNET_CORE_1⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.

Type: Runtime

The .NET Core 1.0 runtime (dotnetcore1.0).


static DOTNET_CORE_2⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.

Type: Runtime

The .NET Core 2.0 runtime (dotnetcore2.0).


static DOTNET_CORE_2_1⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.

Type: Runtime

The .NET Core 2.1 runtime (dotnetcore2.1).


static DOTNET_CORE_3_1⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.

Type: Runtime

The .NET Core 3.1 runtime (dotnetcore3.1).


static FROM_IMAGE

Type: Runtime

A special runtime entry to be used when function is using a docker image.


static GO_1_X

Type: Runtime

The Go 1.x runtime (go1.x).


static JAVA_11

Type: Runtime

The Java 11 runtime (java11).


static JAVA_17

Type: Runtime

The Java 17 runtime (java17).


static JAVA_8

Type: Runtime

The Java 8 runtime (java8).


static JAVA_8_CORRETTO

Type: Runtime

The Java 8 Corretto runtime (java8.al2).


static NODEJS⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

Type: Runtime

The NodeJS runtime (nodejs).


static NODEJS_10_X⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

Type: Runtime

The NodeJS 10.x runtime (nodejs10.x).


static NODEJS_12_X⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

Type: Runtime

The NodeJS 12.x runtime (nodejs12.x).


static NODEJS_14_X

Type: Runtime

The NodeJS 14.x runtime (nodejs14.x).


static NODEJS_16_X

Type: Runtime

The NodeJS 16.x runtime (nodejs16.x).


static NODEJS_18_X

Type: Runtime

The NodeJS 18.x runtime (nodejs18.x).


static NODEJS_4_3⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

Type: Runtime

The NodeJS 4.3 runtime (nodejs4.3).


static NODEJS_6_10⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

Type: Runtime

The NodeJS 6.10 runtime (nodejs6.10).


static NODEJS_8_10⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.

Type: Runtime

The NodeJS 8.10 runtime (nodejs8.10).


static PROVIDED

Type: Runtime

The custom provided runtime (provided).


static PROVIDED_AL2

Type: Runtime

The custom provided runtime (provided).


static PYTHON_2_7⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.

Type: Runtime

The Python 2.7 runtime (python2.7).


static PYTHON_3_10

Type: Runtime

The Python 3.10 runtime (python3.10).


static PYTHON_3_6⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.

Type: Runtime

The Python 3.6 runtime (python3.6) (not recommended).

The Python 3.6 runtime is deprecated as of July 2022.


static PYTHON_3_7

Type: Runtime

The Python 3.7 runtime (python3.7).


static PYTHON_3_8

Type: Runtime

The Python 3.8 runtime (python3.8).


static PYTHON_3_9

Type: Runtime

The Python 3.9 runtime (python3.9).


static RUBY_2_5⚠️

⚠️ Deprecated: Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Ruby runtime.

Type: Runtime

The Ruby 2.5 runtime (ruby2.5).


static RUBY_2_7

Type: Runtime

The Ruby 2.7 runtime (ruby2.7).


static RUBY_3_2

Type: Runtime

The Ruby 3.2 runtime (ruby3.2).

Methods

NameDescription
runtimeEquals(other)
toString()

runtimeEquals(other)

public runtimeEquals(other: Runtime): boolean

Parameters

  • other Runtime

Returns

  • boolean

toString()

public toString(): string

Returns

  • string