Interface VersionOptions
- All Superinterfaces:
EventInvokeConfigOptions,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
VersionProps
- All Known Implementing Classes:
VersionOptions.Jsii$Proxy,VersionProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)",
date="2025-12-18T18:20:12.829Z")
@Stability(Stable)
public interface VersionOptions
extends software.amazon.jsii.JsiiSerializable, EventInvokeConfigOptions
Options for
lambda.Version.
Example:
Function fn = Function.Builder.create(this, "MyFunction")
.currentVersionOptions(VersionOptions.builder()
.removalPolicy(RemovalPolicy.RETAIN) // retain old versions
.retryAttempts(1)
.build())
.runtime(Runtime.NODEJS_18_X)
.handler("index.handler")
.code(Code.fromAsset(join(__dirname, "lambda-handler")))
.build();
fn.addAlias("live");
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forVersionOptionsstatic final classAn implementation forVersionOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic VersionOptions.Builderbuilder()default StringSHA256 of the version of the Lambda source code.default StringDescription of the version.default NumberThe maximum number of execution environments allowed for this version when published into a capacity provider.default NumberThe minimum number of execution environments to maintain for this version when published into a capacity provider.default NumberSpecifies a provisioned concurrency configuration for a function's version.default RemovalPolicyWhether to retain old versions of this function when a new version is created.Methods inherited from interface software.amazon.awscdk.services.lambda.EventInvokeConfigOptions
getMaxEventAge, getOnFailure, getOnSuccess, getRetryAttemptsMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCodeSha256
SHA256 of the version of the Lambda source code.Specify to validate that you're deploying the right version.
Default: No validation is performed
-
getDescription
Description of the version.Default: Description of the Lambda
-
getMaxExecutionEnvironments
The maximum number of execution environments allowed for this version when published into a capacity provider.This setting limits the total number of execution environments that can be created to handle concurrent invocations of this specific version.
Default: - No maximum specified
-
getMinExecutionEnvironments
The minimum number of execution environments to maintain for this version when published into a capacity provider.This setting ensures that at least this many execution environments are always available to handle function invocations for this specific version, reducing cold start latency.
Default: - 3 execution environments are set to be the minimum
-
getProvisionedConcurrentExecutions
Specifies a provisioned concurrency configuration for a function's version.Default: No provisioned concurrency
-
getRemovalPolicy
Whether to retain old versions of this function when a new version is created.Default: RemovalPolicy.DESTROY
-
builder
- Returns:
- a
VersionOptions.BuilderofVersionOptions
-