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.97.0 (build 729de35)", date="2024-04-18T17:54:19.297Z") @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

    • 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