Class CfnAlias

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:40.560Z") @Stability(Stable) public class CfnAlias extends CfnResource implements IInspectable
A CloudFormation AWS::Lambda::Alias.

The AWS::Lambda::Alias resource creates an alias for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version.

You can also map an alias to split invocation requests between two versions. Use the RoutingConfig parameter to specify a second version and the percentage of invocation requests that it receives.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lambda.*;
 CfnAlias cfnAlias = CfnAlias.Builder.create(this, "MyCfnAlias")
         .functionName("functionName")
         .functionVersion("functionVersion")
         .name("name")
         // the properties below are optional
         .description("description")
         .provisionedConcurrencyConfig(ProvisionedConcurrencyConfigurationProperty.builder()
                 .provisionedConcurrentExecutions(123)
                 .build())
         .routingConfig(AliasRoutingConfigurationProperty.builder()
                 .additionalVersionWeights(List.of(VersionWeightProperty.builder()
                         .functionVersion("functionVersion")
                         .functionWeight(123)
                         .build()))
                 .build())
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAlias

      protected CfnAlias(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAlias

      protected CfnAlias(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAlias

      @Stability(Stable) public CfnAlias(@NotNull Construct scope, @NotNull String id, @NotNull CfnAliasProps props)
      Create a new AWS::Lambda::Alias.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getFunctionName

      @Stability(Stable) @NotNull public String getFunctionName()
      The name of the Lambda function.

      Name formats - Function name - MyFunction .

      • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
      • Partial ARN - 123456789012:function:MyFunction .

      The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

    • setFunctionName

      @Stability(Stable) public void setFunctionName(@NotNull String value)
      The name of the Lambda function.

      Name formats - Function name - MyFunction .

      • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
      • Partial ARN - 123456789012:function:MyFunction .

      The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

    • getFunctionVersion

      @Stability(Stable) @NotNull public String getFunctionVersion()
      The function version that the alias invokes.
    • setFunctionVersion

      @Stability(Stable) public void setFunctionVersion(@NotNull String value)
      The function version that the alias invokes.
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of the alias.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the alias.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A description of the alias.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A description of the alias.
    • getProvisionedConcurrencyConfig

      @Stability(Stable) @Nullable public Object getProvisionedConcurrencyConfig()
      Specifies a provisioned concurrency configuration for a function's alias.
    • setProvisionedConcurrencyConfig

      @Stability(Stable) public void setProvisionedConcurrencyConfig(@Nullable CfnAlias.ProvisionedConcurrencyConfigurationProperty value)
      Specifies a provisioned concurrency configuration for a function's alias.
    • setProvisionedConcurrencyConfig

      @Stability(Stable) public void setProvisionedConcurrencyConfig(@Nullable IResolvable value)
      Specifies a provisioned concurrency configuration for a function's alias.
    • getRoutingConfig

      @Stability(Stable) @Nullable public Object getRoutingConfig()
      The routing configuration of the alias.
    • setRoutingConfig

      @Stability(Stable) public void setRoutingConfig(@Nullable IResolvable value)
      The routing configuration of the alias.
    • setRoutingConfig

      @Stability(Stable) public void setRoutingConfig(@Nullable CfnAlias.AliasRoutingConfigurationProperty value)
      The routing configuration of the alias.