AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

Alias

A new alias to a particular version of a Lambda function.

Import

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

Or use the module namespace:

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

Properties

Configuration passed to the constructor as AliasProps.

aliasNameRequired
string

Name of this alias.

versionRequired
IVersion

Function version this alias refers to. Use lambda.currentVersion to reference a version with your latest changes.

3 properties inherited from AliasOptions
additionalVersionsOptionalinherited from AliasOptions
VersionWeight[]

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

descriptionOptionalinherited from AliasOptions
string

Description for the alias.

Default: No description

provisionedConcurrentExecutionsOptionalinherited from AliasOptions
number

Specifies a provisioned concurrency configuration for a function's alias.

Default: No provisioned concurrency

4 properties inherited from EventInvokeConfigOptions
maxEventAgeOptionalinherited from EventInvokeConfigOptions
Duration

The maximum age of a request that Lambda sends to a function for processing. Minimum: 60 seconds Maximum: 6 hours

Default: Duration.hours(6)

onFailureOptionalinherited from EventInvokeConfigOptions
IDestination

The destination for failed invocations.

Default: - no destination

onSuccessOptionalinherited from EventInvokeConfigOptions
IDestination

The destination for successful invocations.

Default: - no destination

retryAttemptsOptionalinherited from EventInvokeConfigOptions
number

The maximum number of times to retry when the function returns an error. Minimum: 0 Maximum: 2

Default: 2

Get the AWS Lambda Cheat Sheet

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

Download Free Infographic