Class VersionProps.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.VersionProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<VersionProps>
- Enclosing interface:
VersionProps
@Stability(Stable)
public static final class VersionProps.Builder
extends Object
implements software.amazon.jsii.Builder<VersionProps>
A builder for
VersionProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.codeSha256(String codeSha256) Sets the value ofVersionOptions.getCodeSha256()description(String description) Sets the value ofVersionOptions.getDescription()Sets the value ofVersionProps.getLambda()maxEventAge(Duration maxEventAge) Sets the value ofEventInvokeConfigOptions.getMaxEventAge()maxExecutionEnvironments(Number maxExecutionEnvironments) Sets the value ofVersionOptions.getMaxExecutionEnvironments()minExecutionEnvironments(Number minExecutionEnvironments) Sets the value ofVersionOptions.getMinExecutionEnvironments()onFailure(IDestination onFailure) Sets the value ofEventInvokeConfigOptions.getOnFailure()onSuccess(IDestination onSuccess) Sets the value ofEventInvokeConfigOptions.getOnSuccess()provisionedConcurrentExecutions(Number provisionedConcurrentExecutions) Sets the value ofVersionOptions.getProvisionedConcurrentExecutions()removalPolicy(RemovalPolicy removalPolicy) Sets the value ofVersionOptions.getRemovalPolicy()retryAttempts(Number retryAttempts) Sets the value ofEventInvokeConfigOptions.getRetryAttempts()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
lambda
Sets the value ofVersionProps.getLambda()- Parameters:
lambda- Function to get the value of. This parameter is required.- Returns:
this
-
codeSha256
Sets the value ofVersionOptions.getCodeSha256()- Parameters:
codeSha256- SHA256 of the version of the Lambda source code. Specify to validate that you're deploying the right version.- Returns:
this
-
description
Sets the value ofVersionOptions.getDescription()- Parameters:
description- Description of the version.- Returns:
this
-
maxExecutionEnvironments
@Stability(Stable) public VersionProps.Builder maxExecutionEnvironments(Number maxExecutionEnvironments) Sets the value ofVersionOptions.getMaxExecutionEnvironments()- Parameters:
maxExecutionEnvironments- 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.- Returns:
this
-
minExecutionEnvironments
@Stability(Stable) public VersionProps.Builder minExecutionEnvironments(Number minExecutionEnvironments) Sets the value ofVersionOptions.getMinExecutionEnvironments()- Parameters:
minExecutionEnvironments- 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.- Returns:
this
-
provisionedConcurrentExecutions
@Stability(Stable) public VersionProps.Builder provisionedConcurrentExecutions(Number provisionedConcurrentExecutions) Sets the value ofVersionOptions.getProvisionedConcurrentExecutions()- Parameters:
provisionedConcurrentExecutions- Specifies a provisioned concurrency configuration for a function's version.- Returns:
this
-
removalPolicy
Sets the value ofVersionOptions.getRemovalPolicy()- Parameters:
removalPolicy- Whether to retain old versions of this function when a new version is created.- Returns:
this
-
maxEventAge
Sets the value ofEventInvokeConfigOptions.getMaxEventAge()- Parameters:
maxEventAge- The maximum age of a request that Lambda sends to a function for processing. Minimum: 60 seconds Maximum: 6 hours- Returns:
this
-
onFailure
Sets the value ofEventInvokeConfigOptions.getOnFailure()- Parameters:
onFailure- The destination for failed invocations.- Returns:
this
-
onSuccess
Sets the value ofEventInvokeConfigOptions.getOnSuccess()- Parameters:
onSuccess- The destination for successful invocations.- Returns:
this
-
retryAttempts
Sets the value ofEventInvokeConfigOptions.getRetryAttempts()- Parameters:
retryAttempts- The maximum number of times to retry when the function returns an error. Minimum: 0 Maximum: 2- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<VersionProps>- Returns:
- a new instance of
VersionProps - Throws:
NullPointerException- if any required attribute was not provided
-