Class AliasProps.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.AliasProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<AliasProps>
- Enclosing interface:
AliasProps
@Stability(Stable)
public static final class AliasProps.Builder
extends Object
implements software.amazon.jsii.Builder<AliasProps>
A builder for
AliasProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadditionalVersions
(List<? extends VersionWeight> additionalVersions) Sets the value ofAliasOptions.getAdditionalVersions()
Sets the value ofAliasProps.getAliasName()
build()
Builds the configured instance.description
(String description) Sets the value ofAliasOptions.getDescription()
maxEventAge
(Duration maxEventAge) Sets the value ofEventInvokeConfigOptions.getMaxEventAge()
onFailure
(IDestination onFailure) Sets the value ofEventInvokeConfigOptions.getOnFailure()
onSuccess
(IDestination onSuccess) Sets the value ofEventInvokeConfigOptions.getOnSuccess()
provisionedConcurrentExecutions
(Number provisionedConcurrentExecutions) Sets the value ofAliasOptions.getProvisionedConcurrentExecutions()
retryAttempts
(Number retryAttempts) Sets the value ofEventInvokeConfigOptions.getRetryAttempts()
Sets the value ofAliasProps.getVersion()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
aliasName
Sets the value ofAliasProps.getAliasName()
- Parameters:
aliasName
- Name of this alias. This parameter is required.- Returns:
this
-
version
Sets the value ofAliasProps.getVersion()
- Parameters:
version
- Function version this alias refers to. This parameter is required. Use lambda.currentVersion to reference a version with your latest changes.- Returns:
this
-
additionalVersions
@Stability(Stable) public AliasProps.Builder additionalVersions(List<? extends VersionWeight> additionalVersions) Sets the value ofAliasOptions.getAdditionalVersions()
- Parameters:
additionalVersions
- Additional versions with individual weights this alias points to. Individual additional version weights specified here should add up to (less than) one. All remaining weight is routed to the default version.For example, the config is
version: "1" additionalVersions: [{ version: "2", weight: 0.05 }]
Then 5% of traffic will be routed to function version 2, while the remaining 95% of traffic will be routed to function version 1.
- Returns:
this
-
description
Sets the value ofAliasOptions.getDescription()
- Parameters:
description
- Description for the alias.- Returns:
this
-
provisionedConcurrentExecutions
@Stability(Stable) public AliasProps.Builder provisionedConcurrentExecutions(Number provisionedConcurrentExecutions) Sets the value ofAliasOptions.getProvisionedConcurrentExecutions()
- Parameters:
provisionedConcurrentExecutions
- Specifies a provisioned concurrency configuration for a function's alias.- 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:
build
in interfacesoftware.amazon.jsii.Builder<AliasProps>
- Returns:
- a new instance of
AliasProps
- Throws:
NullPointerException
- if any required attribute was not provided
-