

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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::Lambda::Version
<a name="aws-resource-lambda-version"></a>

The `AWS::Lambda::Version` resource creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function. Use versions to create a snapshot of your function code and configuration that doesn't change.

## Syntax
<a name="aws-resource-lambda-version-syntax"></a>

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

### JSON
<a name="aws-resource-lambda-version-syntax.json"></a>

```
{
  "Type" : "AWS::Lambda::Version",
  "Properties" : {
      "[CodeSha256](#cfn-lambda-version-codesha256)" : String,
      "[Description](#cfn-lambda-version-description)" : String,
      "[FunctionName](#cfn-lambda-version-functionname)" : String,
      "[FunctionScalingConfig](#cfn-lambda-version-functionscalingconfig)" : FunctionScalingConfig,
      "[ProvisionedConcurrencyConfig](#cfn-lambda-version-provisionedconcurrencyconfig)" : ProvisionedConcurrencyConfiguration,
      "[RuntimePolicy](#cfn-lambda-version-runtimepolicy)" : RuntimePolicy
    }
}
```

### YAML
<a name="aws-resource-lambda-version-syntax.yaml"></a>

```
Type: AWS::Lambda::Version
Properties:
  [CodeSha256](#cfn-lambda-version-codesha256): String
  [Description](#cfn-lambda-version-description): String
  [FunctionName](#cfn-lambda-version-functionname): String
  [FunctionScalingConfig](#cfn-lambda-version-functionscalingconfig): 
    FunctionScalingConfig
  [ProvisionedConcurrencyConfig](#cfn-lambda-version-provisionedconcurrencyconfig): 
    ProvisionedConcurrencyConfiguration
  [RuntimePolicy](#cfn-lambda-version-runtimepolicy): 
    RuntimePolicy
```

## Properties
<a name="aws-resource-lambda-version-properties"></a>

`CodeSha256`  <a name="cfn-lambda-version-codesha256"></a>
Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. Updates are not supported for this property.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Description`  <a name="cfn-lambda-version-description"></a>
A description for the version to override the description in the function configuration. Updates are not supported for this property.  
*Required*: No  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`FunctionName`  <a name="cfn-lambda-version-functionname"></a>
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.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^(arn:(aws[a-zA-Z-]*)?:lambda:)?((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$`  
*Minimum*: `1`  
*Maximum*: `140`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`FunctionScalingConfig`  <a name="cfn-lambda-version-functionscalingconfig"></a>
Configuration that defines the scaling behavior for a Lambda Managed Instances function, including the minimum and maximum number of execution environments that can be provisioned.  
*Required*: No  
*Type*: [FunctionScalingConfig](aws-properties-lambda-version-functionscalingconfig.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ProvisionedConcurrencyConfig`  <a name="cfn-lambda-version-provisionedconcurrencyconfig"></a>
Specifies a provisioned concurrency configuration for a function's version. Updates are not supported for this property.  
*Required*: No  
*Type*: [ProvisionedConcurrencyConfiguration](aws-properties-lambda-version-provisionedconcurrencyconfiguration.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`RuntimePolicy`  <a name="cfn-lambda-version-runtimepolicy"></a>
Property description not available.  
*Required*: No  
*Type*: [RuntimePolicy](aws-properties-lambda-version-runtimepolicy.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-lambda-version-return-values"></a>

### Ref
<a name="aws-resource-lambda-version-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the ARN of the version, such as `arn:aws:lambda:us-east-2:123456789012:function:helloworld:1`. 

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-lambda-version-return-values-fn--getatt"></a>

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 [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-lambda-version-return-values-fn--getatt-fn--getatt"></a>

`FunctionArn`  <a name="FunctionArn-fn::getatt"></a>
The ARN of the function.

`Version`  <a name="Version-fn::getatt"></a>
The version number.

## Examples
<a name="aws-resource-lambda-version--examples"></a>



### Function Version
<a name="aws-resource-lambda-version--examples--Function_Version"></a>

Publish a version with provisioned concurrency.

#### YAML
<a name="aws-resource-lambda-version--examples--Function_Version--yaml"></a>

```
Resources:
  function:
    Type: AWS::Lambda::Function
    Properties:
      Handler: index.handler
      Role: arn:aws:iam::123456789012:role/lambda-role
      Code:
        ZipFile: |
          exports.handler = async (event) => {
              console.log(JSON.stringify(event, null, 2));
              const response = {
                  statusCode: 200,
                  body: JSON.stringify('Hello from Lambda!'),
              };
              return response;
          };
      Runtime: nodejs18.x
      TracingConfig:
        Mode: Active
  version:
    Type: AWS::Lambda::Version
    Properties:
      FunctionName: !Ref function
      Description: v1
      ProvisionedConcurrencyConfig:
        ProvisionedConcurrentExecutions: 20
```

# AWS::Lambda::Version FunctionScalingConfig
<a name="aws-properties-lambda-version-functionscalingconfig"></a>

Configuration that defines the scaling behavior for a Lambda Managed Instances function, including the minimum and maximum number of execution environments that can be provisioned.

## Syntax
<a name="aws-properties-lambda-version-functionscalingconfig-syntax"></a>

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

### JSON
<a name="aws-properties-lambda-version-functionscalingconfig-syntax.json"></a>

```
{
  "[MaxExecutionEnvironments](#cfn-lambda-version-functionscalingconfig-maxexecutionenvironments)" : Integer,
  "[MinExecutionEnvironments](#cfn-lambda-version-functionscalingconfig-minexecutionenvironments)" : Integer
}
```

### YAML
<a name="aws-properties-lambda-version-functionscalingconfig-syntax.yaml"></a>

```
  [MaxExecutionEnvironments](#cfn-lambda-version-functionscalingconfig-maxexecutionenvironments): Integer
  [MinExecutionEnvironments](#cfn-lambda-version-functionscalingconfig-minexecutionenvironments): Integer
```

## Properties
<a name="aws-properties-lambda-version-functionscalingconfig-properties"></a>

`MaxExecutionEnvironments`  <a name="cfn-lambda-version-functionscalingconfig-maxexecutionenvironments"></a>
The maximum number of execution environments that can be provisioned for the function.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MinExecutionEnvironments`  <a name="cfn-lambda-version-functionscalingconfig-minexecutionenvironments"></a>
The minimum number of execution environments to maintain for the function.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Lambda::Version ProvisionedConcurrencyConfiguration
<a name="aws-properties-lambda-version-provisionedconcurrencyconfiguration"></a>

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

## Syntax
<a name="aws-properties-lambda-version-provisionedconcurrencyconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-lambda-version-provisionedconcurrencyconfiguration-syntax.json"></a>

```
{
  "[ProvisionedConcurrentExecutions](#cfn-lambda-version-provisionedconcurrencyconfiguration-provisionedconcurrentexecutions)" : Integer
}
```

### YAML
<a name="aws-properties-lambda-version-provisionedconcurrencyconfiguration-syntax.yaml"></a>

```
  [ProvisionedConcurrentExecutions](#cfn-lambda-version-provisionedconcurrencyconfiguration-provisionedconcurrentexecutions): Integer
```

## Properties
<a name="aws-properties-lambda-version-provisionedconcurrencyconfiguration-properties"></a>

`ProvisionedConcurrentExecutions`  <a name="cfn-lambda-version-provisionedconcurrencyconfiguration-provisionedconcurrentexecutions"></a>
The amount of provisioned concurrency to allocate for the version.  
*Required*: Yes  
*Type*: Integer  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Examples
<a name="aws-properties-lambda-version-provisionedconcurrencyconfiguration--examples"></a>



### Provisioned Concurrency Configuration
<a name="aws-properties-lambda-version-provisionedconcurrencyconfiguration--examples--Provisioned_Concurrency_Configuration"></a>

Allocate 20 provisioned concurrency for a version.

#### YAML
<a name="aws-properties-lambda-version-provisionedconcurrencyconfiguration--examples--Provisioned_Concurrency_Configuration--yaml"></a>

```
      ProvisionedConcurrencyConfig:
        ProvisionedConcurrentExecutions: 20
```

# AWS::Lambda::Version RuntimePolicy
<a name="aws-properties-lambda-version-runtimepolicy"></a>

Sets the runtime management configuration for a function's version. For more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html).

## Syntax
<a name="aws-properties-lambda-version-runtimepolicy-syntax"></a>

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

### JSON
<a name="aws-properties-lambda-version-runtimepolicy-syntax.json"></a>

```
{
  "[RuntimeVersionArn](#cfn-lambda-version-runtimepolicy-runtimeversionarn)" : String,
  "[UpdateRuntimeOn](#cfn-lambda-version-runtimepolicy-updateruntimeon)" : String
}
```

### YAML
<a name="aws-properties-lambda-version-runtimepolicy-syntax.yaml"></a>

```
  [RuntimeVersionArn](#cfn-lambda-version-runtimepolicy-runtimeversionarn): String
  [UpdateRuntimeOn](#cfn-lambda-version-runtimepolicy-updateruntimeon): String
```

## Properties
<a name="aws-properties-lambda-version-runtimepolicy-properties"></a>

`RuntimeVersionArn`  <a name="cfn-lambda-version-runtimepolicy-runtimeversionarn"></a>
The ARN of the runtime version you want the function to use.  
This is only required if you're using the **Manual** runtime update mode.
*Required*: No  
*Type*: String  
*Pattern*: `^arn:(aws[a-zA-Z-]*):lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}::runtime:.+$`  
*Minimum*: `26`  
*Maximum*: `2048`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`UpdateRuntimeOn`  <a name="cfn-lambda-version-runtimepolicy-updateruntimeon"></a>
Specify the runtime update mode.  
+ **Auto (default)** - Automatically update to the most recent and secure runtime version using a [Two-phase runtime version rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase). This is the best choice for most customers to ensure they always benefit from runtime updates.
+ **FunctionUpdate** - Lambda updates the runtime of you function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.
+ **Manual** - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see [Roll back a runtime version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback).
*Valid Values*: `Auto` \$1 `FunctionUpdate` \$1 `Manual`  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)