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");
 
  • Method Details

    • getCodeSha256

      @Stability(Stable) @Nullable default String 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

      @Stability(Stable) @Nullable default String getDescription()
      Description of the version.

      Default: Description of the Lambda

    • getMaxExecutionEnvironments

      @Stability(Stable) @Nullable default Number 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

      @Stability(Stable) @Nullable default Number 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

      @Stability(Stable) @Nullable default Number getProvisionedConcurrentExecutions()
      Specifies a provisioned concurrency configuration for a function's version.

      Default: No provisioned concurrency

    • getRemovalPolicy

      @Stability(Stable) @Nullable default RemovalPolicy getRemovalPolicy()
      Whether to retain old versions of this function when a new version is created.

      Default: RemovalPolicy.DESTROY

    • builder

      @Stability(Stable) static VersionOptions.Builder builder()
      Returns:
      a VersionOptions.Builder of VersionOptions