View a markdown version of this page

AWS::Lambda::RuntimeVersion - 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::RuntimeVersion

The AWS::Lambda::RuntimeVersion resource creates a runtime version for a customer-managed runtime. A runtime version defines the function execution environment by referencing a container image in Amazon Elastic Container Registry (Amazon ECR). The image of a runtime version can't change: to release a new image, create a new runtime version and point a runtime alias at it.

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 version 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::RuntimeVersion", "Properties" : { "ImageUri" : String, "Name" : String, "ReleaseNotes" : String, "RuntimeName" : String } }

YAML

Type: AWS::Lambda::RuntimeVersion Properties: ImageUri: String Name: String ReleaseNotes: String RuntimeName: String

Properties

ImageUri

The URI of the container image in Amazon ECR that defines the execution environment for this runtime version. The caller must have permission to read the image. CloudFormation doesn't return this value. To get the image that was published, use ResolvedUri.

Required: Yes

Type: String

Update requires: Replacement

Name

The name to assign to the new runtime version.

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

ReleaseNotes

The release notes for the runtime version. If you remove this property from the template, the release notes are cleared.

Required: No

Type: String

Update requires: No interruption

RuntimeName

The name of the runtime that the version 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

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

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: 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 version.

Created

The date and time when the runtime version was created.

LastModified

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

Platforms

The platforms (architecture and OS combinations) available for the runtime version.

ResolvedUri

The resolved image URI of the runtime version.

State

The current state of the runtime version.

Examples

Runtime version

Publish a container image as version v1 of the runtime my-runtime.

JSON

"MyRuntimeVersion": { "Type": "AWS::Lambda::RuntimeVersion", "Properties": { "RuntimeName": { "Ref": "MyRuntimeName" }, "Name": "v1", "ImageUri": "111122223333.dkr.ecr.us-east-1.amazonaws.com/my-runtime-image:v1", "ReleaseNotes": "Initial release" } }

YAML

MyRuntimeVersion: Type: AWS::Lambda::RuntimeVersion Properties: RuntimeName: Ref: MyRuntimeName Name: v1 ImageUri: 111122223333.dkr.ecr.us-east-1.amazonaws.com/my-runtime-image:v1 ReleaseNotes: Initial release