AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::Lambda::Alias

CfnAlias

The `AWS::Lambda::Alias` resource creates an [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) 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.

Import

import { CfnAlias } from 'aws-cdk-lib/aws-lambda';

Or use the module namespace:

import * as lambda from 'aws-cdk-lib/aws-lambda';
// lambda.CfnAlias

Properties

Configuration passed to the constructor as CfnAliasProps.

functionNameRequired
string | IFunctionRef

The name or ARN 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.

functionVersionRequired
string

The function version that the alias invokes.

nameRequired
string

The name of the alias.

descriptionOptional
string

A description of the alias.

provisionedConcurrencyConfigOptional
IResolvable | ProvisionedConcurrencyConfigurationProperty

Specifies a [provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html) configuration for a function's alias.

routingConfigOptional
IResolvable | AliasRoutingConfigurationProperty

The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the AWS Lambda Cheat Sheet

Everything you need to know about AWS Lambda on one page. HD quality, print-friendly.

Download Free Infographic