Class Alias.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.Alias.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Alias>
- Enclosing class:
- Alias
@Stability(Stable)
public static final class Alias.Builder
extends Object
implements software.amazon.jsii.Builder<Alias>
A fluent builder for
Alias
.-
Method Summary
Modifier and TypeMethodDescriptionadditionalVersions
(List<? extends VersionWeight> additionalVersions) Additional versions with individual weights this alias points to.Name of this alias.build()
static Alias.Builder
description
(String description) Description for the alias.maxEventAge
(Duration maxEventAge) The maximum age of a request that Lambda sends to a function for processing.onFailure
(IDestination onFailure) The destination for failed invocations.onSuccess
(IDestination onSuccess) The destination for successful invocations.provisionedConcurrentExecutions
(Number provisionedConcurrentExecutions) Specifies a provisioned concurrency configuration for a function's alias.retryAttempts
(Number retryAttempts) The maximum number of times to retry when the function returns an error.Function version this alias refers to.
-
Method Details
-
create
@Stability(Stable) public static Alias.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
Alias.Builder
.
-
maxEventAge
The maximum age of a request that Lambda sends to a function for processing.Minimum: 60 seconds Maximum: 6 hours
Default: Duration.hours(6)
- Parameters:
maxEventAge
- The maximum age of a request that Lambda sends to a function for processing. This parameter is required.- Returns:
this
-
onFailure
The destination for failed invocations.Default: - no destination
- Parameters:
onFailure
- The destination for failed invocations. This parameter is required.- Returns:
this
-
onSuccess
The destination for successful invocations.Default: - no destination
- Parameters:
onSuccess
- The destination for successful invocations. This parameter is required.- Returns:
this
-
retryAttempts
The maximum number of times to retry when the function returns an error.Minimum: 0 Maximum: 2
Default: 2
- Parameters:
retryAttempts
- The maximum number of times to retry when the function returns an error. This parameter is required.- Returns:
this
-
additionalVersions
@Stability(Stable) public Alias.Builder additionalVersions(List<? extends VersionWeight> 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.
Default: No additional versions
- Parameters:
additionalVersions
- Additional versions with individual weights this alias points to. This parameter is required.- Returns:
this
-
description
Description for the alias.Default: No description
- Parameters:
description
- Description for the alias. This parameter is required.- Returns:
this
-
provisionedConcurrentExecutions
@Stability(Stable) public Alias.Builder provisionedConcurrentExecutions(Number provisionedConcurrentExecutions) Specifies a provisioned concurrency configuration for a function's alias.Default: No provisioned concurrency
- Parameters:
provisionedConcurrentExecutions
- Specifies a provisioned concurrency configuration for a function's alias. This parameter is required.- Returns:
this
-
aliasName
Name of this alias.- Parameters:
aliasName
- Name of this alias. This parameter is required.- Returns:
this
-
version
Function version this alias refers to.Use lambda.currentVersion to reference a version with your latest changes.
- Parameters:
version
- Function version this alias refers to. This parameter is required.- Returns:
this
-
build
-