View a markdown version of this page

AWS::Lambda::RuntimeAlias - AWS CloudFormation

This is the new CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.

AWS::Lambda::RuntimeAlias

The AWS::Lambda::RuntimeAlias resource creates a runtime alias for a customer-managed runtime. A runtime alias is a named pointer to a runtime version. Functions use a customer-managed runtime through a runtime alias, so updating the alias's RuntimeVersion releases a new version to those functions, and pointing it back rolls the release back.

When you delete this resource, Lambda schedules it for deletion after a 30-day recovery window, and CloudFormation treats it as deleted. Until the window ends, the name stays reserved: you can't create a runtime alias with the same name, so use a new name if you re-create it.

Syntax

To declare this entity in your CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Lambda::RuntimeAlias", "Properties" : { "Description" : String, "Name" : String, "ReleaseLifecycle" : ReleaseLifecycle, "RuntimeName" : String, "RuntimeVersion" : String } }

YAML

Type: AWS::Lambda::RuntimeAlias Properties: Description: String Name: String ReleaseLifecycle: ReleaseLifecycle RuntimeName: String RuntimeVersion: String

Properties

Description

A description of the runtime alias. If you remove this property from the template, the description is cleared.

Required: No

Type: String

Minimum: 1

Maximum: 1024

Update requires: No interruption

Name

The name to assign to the new runtime alias.

Required: Yes

Type: String

Pattern: ^[A-Za-z0-9_]([A-Za-z0-9_.-]{0,126}[A-Za-z0-9_])?$

Minimum: 1

Maximum: 128

Update requires: Replacement

ReleaseLifecycle

The runtime lifecycle for the alias. By default, this is inherited from the runtime lifecycle. Optionally, you can override the lifecycle information at the alias level, if required.

Required: No

Type: ReleaseLifecycle

Update requires: No interruption

RuntimeName

The name of the runtime that the alias belongs to.

Required: Yes

Type: String

Pattern: ^[a-z0-9]([a-z0-9_.-]{0,126})?[a-z0-9]$

Minimum: 2

Maximum: 128

Update requires: Replacement

RuntimeVersion

The name of the runtime version the alias points to.

Required: Yes

Type: String

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the Amazon Resource Name (ARN) of the runtime alias.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Compatibility

The compatibility of the runtime version that the alias points to: the integration models and architectures it supports, and whether it supports Lambda Managed Instances. The value is a Compatibility object.

Arn

The Amazon Resource Name (ARN) of the runtime alias.

Created

The date and time when the runtime alias was created.

LastModified

The date and time when the runtime alias was last modified.

RuntimeVersionArn

The Amazon Resource Name (ARN) of the runtime version the alias points to.

State

The current state of the runtime alias.

Examples

Runtime alias

Create a runtime alias named stable that points to version v1 of the runtime.

JSON

"MyRuntimeAlias": { "Type": "AWS::Lambda::RuntimeAlias", "Properties": { "RuntimeName": { "Ref": "MyRuntimeName" }, "Name": "stable", "RuntimeVersion": "v1", "Description": "Version used by production functions" } }

YAML

MyRuntimeAlias: Type: AWS::Lambda::RuntimeAlias Properties: RuntimeName: Ref: MyRuntimeName Name: stable RuntimeVersion: v1 Description: Version used by production functions