AWS CloudFormation
User Guide (API Version 2010-05-15)


The AWS::Lambda::Version resource publishes a specified version of an AWS Lambda (Lambda) function. When publishing a new version of your function, Lambda copies the latest version of your function. For more information, see Introduction to AWS Lambda Versioning in the AWS Lambda Developer Guide.


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


{ "Type" : "AWS::Lambda::Version", "Properties" : { "CodeSha256" : String, "Description" : String, "FunctionName" : String } }


Type: AWS::Lambda::Version Properties: CodeSha256 : String Description : String FunctionName : String



The SHA-256 hash of the deployment package that you want to publish. This value must match the SHA-256 hash of the $LATEST version of the function. Specify this property to validate that you are publishing the correct package.

Required: No

Type: String

Update requires: Updates are not supported.


A description of the version you are publishing. If you don't specify a value, Lambda copies the description from the $LATEST version of the function.

Required: No

Type: String

Update requires: Updates are not supported.


The Lambda function for which you want to publish a version. You can specify the function's name or its Amazon Resource Name (ARN).

Required: Yes

Type: String

Update requires: Replacement

Return Values


When the logical ID of this resource is provided to the Ref intrinsic function, Ref returns the ARN of the Lambda version, such as arn:aws:lambda:us-west-2:123456789012:function:helloworld:1.

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


Fn::GetAtt returns a value for a specified attribute of the specified resource type.


The published version of a Lambda version, such as 1.

For more information about using Fn::GetAtt, see Fn::GetAtt.


The following example publishes a new version of the MyFunction Lambda function.


"TestingNewFeature" : { "Type" : "AWS::Lambda::Version", "Properties" : { "FunctionName" : { "Ref" : "MyFunction" }, "Description" : "A test version of MyFunction" } }


TestingNewFeature: Type: AWS::Lambda::Version Properties: FunctionName: Ref: "MyFunction" Description: "A test version of MyFunction"