Class Runtime
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.Runtime
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:08.571Z")
@Stability(Stable)
public class Runtime
extends software.amazon.jsii.JsiiObject
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:
// Create or reference an existing L1 CfnApplicationInferenceProfile
CfnApplicationInferenceProfile cfnProfile = CfnApplicationInferenceProfile.Builder.create(this, "CfnProfile")
.inferenceProfileName("my-cfn-profile")
.modelSource(InferenceProfileModelSourceProperty.builder()
.copyFrom(BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0.getInvokableArn())
.build())
.description("Profile created via L1 construct")
.build();
// Import the L1 construct as an L2 ApplicationInferenceProfile
IInferenceProfile importedFromCfn = ApplicationInferenceProfile.fromCfnApplicationInferenceProfile(cfnProfile);
// Grant permissions to use the imported profile
Function lambdaFunction = Function.Builder.create(this, "MyFunction")
.runtime(Runtime.PYTHON_3_11)
.handler("index.handler")
.code(Code.fromInline("def handler(event, context): return \"Hello\""))
.build();
importedFromCfn.grantProfileUsage(lambdaFunction);
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Field Summary
FieldsModifier and TypeFieldDescriptionA list of all knownRuntime's.static final RuntimeThe .NET 6 runtime (dotnet6).static final RuntimeThe .NET 8 runtime (dotnet8).static final RuntimeThe .NET 9 runtime (dotnet9).static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeA special runtime entry to be used when function is using a docker image.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeThe Java 11 runtime (java11).static final RuntimeThe Java 17 runtime (java17).static final RuntimeThe Java 21 runtime (java21).static final RuntimeThe Java 25 runtime (java25).static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeThe Java 8 Corretto runtime (java8.al2).static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeThe NodeJS 18.x runtime (nodejs18.x).static final RuntimeThe NodeJS 20.x runtime (nodejs20.x).static final RuntimeThe NodeJS 22.x runtime (nodejs22.x).static final RuntimeThe NodeJS 24.x runtime (nodejs24.x).static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeThe latest NodeJS version currently available in ALL regions (not necessarily the latest NodeJS version available in YOUR region).static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeThe custom provided runtime with Amazon Linux 2 (provided.al2).static final RuntimeThe custom provided runtime with Amazon Linux 2023 (provided.al2023).static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeThe Python 3.10 runtime (python3.10).static final RuntimeThe Python 3.11 runtime (python3.11).static final RuntimeThe Python 3.12 runtime (python3.12).static final RuntimeThe Python 3.13 runtime (python3.13).static final RuntimeThe Python 3.14 runtime (python3.14).static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeThe Python 3.9 runtime (python3.9).static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeDeprecated.Legacy runtime no longer supported by AWS Lambda.static final RuntimeThe Ruby 3.2 runtime (ruby3.2).static final RuntimeThe Ruby 3.3 runtime (ruby3.3).static final RuntimeThe Ruby 3.4 runtime (ruby3.4). -
Constructor Summary
ConstructorsModifierConstructorDescriptionRuntime(String name, RuntimeFamily family) Runtime(String name, RuntimeFamily family, LambdaRuntimeProps props) protectedRuntime(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedRuntime(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimedetermineLatestPythonRuntime(software.constructs.Construct scope) The latest Python version currently available.The bundling Docker image for this runtime.The runtime family.Enabled for runtime enums that always target the latest available.getName()The name of this runtime, as expected by the Lambda resource.Whether this runtime is integrated with and supported for profiling using Amazon CodeGuru Profiler.Whether theZipFile(aka inline code) property can be used with this runtime.Whether this runtime supports snapstart.runtimeEquals(Runtime other) toString()Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
ALL
A list of all knownRuntime's. -
DOTNET_6
The .NET 6 runtime (dotnet6). -
DOTNET_8
The .NET 8 runtime (dotnet8). -
DOTNET_9
The .NET 9 runtime (dotnet9). -
DOTNET_CORE_1
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.(deprecated) The .NET Core 1.0 runtime (dotnetcore1.0). -
DOTNET_CORE_2
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.(deprecated) The .NET Core 2.0 runtime (dotnetcore2.0). -
DOTNET_CORE_2_1
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.(deprecated) The .NET Core 2.1 runtime (dotnetcore2.1). -
DOTNET_CORE_3_1
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.(deprecated) The .NET Core 3.1 runtime (dotnetcore3.1). -
FROM_IMAGE
A special runtime entry to be used when function is using a docker image. -
GO_1_X
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the PROVIDED_AL2023 runtime.(deprecated) The Go 1.x runtime (go1.x). -
JAVA_11
The Java 11 runtime (java11). -
JAVA_17
The Java 17 runtime (java17). -
JAVA_21
The Java 21 runtime (java21). -
JAVA_25
The Java 25 runtime (java25). -
JAVA_8
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Java runtime.(deprecated) The Java 8 runtime (java8). -
JAVA_8_CORRETTO
The Java 8 Corretto runtime (java8.al2). -
NODEJS
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.(deprecated) The NodeJS runtime (nodejs). -
NODEJS_10_X
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.(deprecated) The NodeJS 10.x runtime (nodejs10.x). -
NODEJS_12_X
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.(deprecated) The NodeJS 12.x runtime (nodejs12.x). -
NODEJS_14_X
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.(deprecated) The NodeJS 14.x runtime (nodejs14.x). -
NODEJS_16_X
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.(deprecated) The NodeJS 16.x runtime (nodejs16.x). -
NODEJS_18_X
The NodeJS 18.x runtime (nodejs18.x). -
NODEJS_20_X
The NodeJS 20.x runtime (nodejs20.x). -
NODEJS_22_X
The NodeJS 22.x runtime (nodejs22.x). -
NODEJS_24_X
The NodeJS 24.x runtime (nodejs24.x). -
NODEJS_4_3
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.(deprecated) The NodeJS 4.3 runtime (nodejs4.3). -
NODEJS_6_10
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.(deprecated) The NodeJS 6.10 runtime (nodejs6.10). -
NODEJS_8_10
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.(deprecated) The NodeJS 8.10 runtime (nodejs8.10). -
NODEJS_LATEST
The latest NodeJS version currently available in ALL regions (not necessarily the latest NodeJS version available in YOUR region). -
PROVIDED
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest provided.al2023 runtime.(deprecated) The custom provided runtime (provided). -
PROVIDED_AL2
The custom provided runtime with Amazon Linux 2 (provided.al2). -
PROVIDED_AL2023
The custom provided runtime with Amazon Linux 2023 (provided.al2023). -
PYTHON_2_7
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.(deprecated) The Python 2.7 runtime (python2.7). -
PYTHON_3_10
The Python 3.10 runtime (python3.10). -
PYTHON_3_11
The Python 3.11 runtime (python3.11). -
PYTHON_3_12
The Python 3.12 runtime (python3.12). -
PYTHON_3_13
The Python 3.13 runtime (python3.13). -
PYTHON_3_14
The Python 3.14 runtime (python3.14). -
PYTHON_3_6
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.(deprecated) The Python 3.6 runtime (python3.6) (not recommended).The Python 3.6 runtime is deprecated as of July 2022.
-
PYTHON_3_7
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.(deprecated) The Python 3.7 runtime (python3.7). -
PYTHON_3_8
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.(deprecated) The Python 3.8 runtime (python3.8). -
PYTHON_3_9
The Python 3.9 runtime (python3.9). -
RUBY_2_5
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Ruby runtime.(deprecated) The Ruby 2.5 runtime (ruby2.5). -
RUBY_2_7
Deprecated.Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Ruby runtime.(deprecated) The Ruby 2.7 runtime (ruby2.7). -
RUBY_3_2
The Ruby 3.2 runtime (ruby3.2). -
RUBY_3_3
The Ruby 3.3 runtime (ruby3.3). -
RUBY_3_4
The Ruby 3.4 runtime (ruby3.4).
-
-
Constructor Details
-
Runtime
protected Runtime(software.amazon.jsii.JsiiObjectRef objRef) -
Runtime
protected Runtime(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Runtime
@Stability(Stable) public Runtime(@NotNull String name, @Nullable RuntimeFamily family, @Nullable LambdaRuntimeProps props) - Parameters:
name- This parameter is required.family-props-
-
Runtime
- Parameters:
name- This parameter is required.family-
-
Runtime
- Parameters:
name- This parameter is required.
-
-
Method Details
-
determineLatestPythonRuntime
@Stability(Stable) @NotNull public static Runtime determineLatestPythonRuntime(@NotNull software.constructs.Construct scope) The latest Python version currently available.- Parameters:
scope- This parameter is required.
-
runtimeEquals
- Parameters:
other- This parameter is required.
-
toString
-
getBundlingImage
The bundling Docker image for this runtime. -
getIsVariable
Enabled for runtime enums that always target the latest available. -
getName
The name of this runtime, as expected by the Lambda resource. -
getSupportsCodeGuruProfiling
Whether this runtime is integrated with and supported for profiling using Amazon CodeGuru Profiler. -
getSupportsInlineCode
Whether theZipFile(aka inline code) property can be used with this runtime. -
getSupportsSnapStart
Whether this runtime supports snapstart. -
getFamily
The runtime family.
-