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 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

      @Stability(Stable) public Alias.Builder maxEventAge(Duration 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

      @Stability(Stable) public Alias.Builder onFailure(IDestination onFailure)
      The destination for failed invocations.

      Default: - no destination

      Parameters:
      onFailure - The destination for failed invocations. This parameter is required.
      Returns:
      this
    • onSuccess

      @Stability(Stable) public Alias.Builder onSuccess(IDestination onSuccess)
      The destination for successful invocations.

      Default: - no destination

      Parameters:
      onSuccess - The destination for successful invocations. This parameter is required.
      Returns:
      this
    • retryAttempts

      @Stability(Stable) public Alias.Builder retryAttempts(Number 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

      @Stability(Stable) public Alias.Builder description(String 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

      @Stability(Stable) public Alias.Builder aliasName(String aliasName)
      Name of this alias.

      Parameters:
      aliasName - Name of this alias. This parameter is required.
      Returns:
      this
    • version

      @Stability(Stable) public Alias.Builder version(IVersion 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

      @Stability(Stable) public Alias build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Alias>
      Returns:
      a newly built instance of Alias.