

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 Step Functions
<a name="AWS_StepFunctions"></a>

**Resource types**
+ [AWS::StepFunctions::Activity](aws-resource-stepfunctions-activity.md)
+ [AWS::StepFunctions::StateMachine](aws-resource-stepfunctions-statemachine.md)
+ [AWS::StepFunctions::StateMachineAlias](aws-resource-stepfunctions-statemachinealias.md)
+ [AWS::StepFunctions::StateMachineVersion](aws-resource-stepfunctions-statemachineversion.md)

# AWS::StepFunctions::Activity
<a name="aws-resource-stepfunctions-activity"></a>

An activity is a task that you write in any programming language and host on any machine that has access to AWS Step Functions. Activities must poll Step Functions using the `GetActivityTask` API action and respond using `SendTask*` API actions. This function makes Step Functions aware of your activity and returns an identifier for use in a state machine and when polling from the activity.

For information about creating an activity, see [Creating an Activity State Machine](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-creating-activity-state-machine.html) in the *AWS Step Functions Developer Guide* and [CreateActivity](https://docs.aws.amazon.com/step-functions/latest/apireference/API_CreateActivity.html) in the *AWS Step Functions API Reference*.

## Syntax
<a name="aws-resource-stepfunctions-activity-syntax"></a>

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

### JSON
<a name="aws-resource-stepfunctions-activity-syntax.json"></a>

```
{
  "Type" : "AWS::StepFunctions::Activity",
  "Properties" : {
      "[EncryptionConfiguration](#cfn-stepfunctions-activity-encryptionconfiguration)" : EncryptionConfiguration,
      "[Name](#cfn-stepfunctions-activity-name)" : String,
      "[Tags](#cfn-stepfunctions-activity-tags)" : [ TagsEntry, ... ]
    }
}
```

### YAML
<a name="aws-resource-stepfunctions-activity-syntax.yaml"></a>

```
Type: AWS::StepFunctions::Activity
Properties:
  [EncryptionConfiguration](#cfn-stepfunctions-activity-encryptionconfiguration): 
    EncryptionConfiguration
  [Name](#cfn-stepfunctions-activity-name): String
  [Tags](#cfn-stepfunctions-activity-tags): 
    - TagsEntry
```

## Properties
<a name="aws-resource-stepfunctions-activity-properties"></a>

`EncryptionConfiguration`  <a name="cfn-stepfunctions-activity-encryptionconfiguration"></a>
Encryption configuration for the activity.  
Activity configuration is immutable, and resource names must be unique. To set customer managed keys for encryption, you must create a **new Activity**. If you attempt to change the configuration in your CFN template for an existing activity, you will receive an `ActivityAlreadyExists` exception.   
 To update your activity to include customer managed keys, set a new activity name within your CloudFormation template.   
*Required*: No  
*Type*: [EncryptionConfiguration](aws-properties-stepfunctions-activity-encryptionconfiguration.md)  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Name`  <a name="cfn-stepfunctions-activity-name"></a>
The name of the activity.  
A name must *not* contain:  
+ white space
+ brackets `< > { } [ ]`
+ wildcard characters `? *`
+ special characters `" # % \ ^ | ~ ` $ & , ; : /`
+ control characters (`U+0000-001F`, `U+007F-009F`, `U+FFFE-FFFF`)
+ surrogates (`U+D800-DFFF`)
+ invalid characters (` U+10FFFF`)
To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and \$1.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `80`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Tags`  <a name="cfn-stepfunctions-activity-tags"></a>
The list of tags to add to a resource.  
Tags may only contain Unicode letters, digits, white space, or these symbols: `_ . : / = + - @`.  
*Required*: No  
*Type*: Array of [TagsEntry](aws-properties-stepfunctions-activity-tagsentry.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-stepfunctions-activity-return-values"></a>

### Ref
<a name="aws-resource-stepfunctions-activity-return-values-ref"></a>

When you provide the logical ID of this resource to the `Ref` intrinsic function, `Ref` returns the ARN of the created activity. For example:

 `{ "Ref": "MyActivity" }` 

Returns a value similar to the following:

 `arn:aws:states:us-east-1:111122223333:activity:myActivity` 

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

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

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

#### 
<a name="aws-resource-stepfunctions-activity-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
Returns the ARN of the resource.

`Name`  <a name="Name-fn::getatt"></a>
Returns the name of the activity. For example:  
 `{ "Fn::GetAtt": ["MyActivity", "Name"] }`   
Returns a value similar to the following:  
 `myActivity`   
For more information about using `Fn::GetAtt`, see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).

## Examples
<a name="aws-resource-stepfunctions-activity--examples"></a>

The following examples create Step Functions activities.

Note that Activity configuration is immutable, and resource names must be unique. To set customer managed keys for encryption, you must create a **new Activity**. If you attempt to change the configuration in your CFN template for an existing activity, you will receive an `ActivityAlreadyExists` exception. 

 To update your activity to include customer managed keys, set a new activity name within your CFN template. The following shows an example that creates a new activity with a customer managed key configuration: 

**Topics**
+ [Create an activity](#aws-resource-stepfunctions-activity--examples--Create_an_activity)
+ [Create an activity with a customer managed AWS KMS key](#aws-resource-stepfunctions-activity--examples--Create_an_activity_with_a_customer_managed_key)

### Create an activity
<a name="aws-resource-stepfunctions-activity--examples--Create_an_activity"></a>

#### YAML
<a name="aws-resource-stepfunctions-activity--examples--Create_an_activity--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Description: An example template for a new Activity.
Resources:
    Activity:
    Type: AWS::StepFunctions::Activity
    Properties:
        Name: myActivity
        EncryptionConfiguration:
            Type: AWS_OWNED_KEY
        Tags:
        -
          Key: "keyname1"
          Value: "value1"
        -
          Key: "keyname2"
          Value: "value2"
```

#### JSON
<a name="aws-resource-stepfunctions-activity--examples--Create_an_activity--json"></a>

```
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "An example template for a Step Functions activity.",
"Resources" : {
    "MyActivity" : {
        "Type" : "AWS::StepFunctions::Activity",
        "Properties" : {
            "Name" : "myActivity",
            "EncryptionConfiguration" : {
                "Type": "AWS_OWNED_KEY",
            }
            "Tags": [
                    {
                        "Key": "keyname1",
                        "Value": "value1"
                    },
                    {
                        "Key": "keyname2",
                        "Value": "value2"
                    }
                ]
            }
        }
    }
}
```

### Create an activity with a customer managed AWS KMS key
<a name="aws-resource-stepfunctions-activity--examples--Create_an_activity_with_a_customer_managed_key"></a>

#### YAML
<a name="aws-resource-stepfunctions-activity--examples--Create_an_activity_with_a_customer_managed_key--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Description: An example template for an Activity with customer managed key encryption.
Resources:
    Activity:
    Type: AWS::StepFunctions::Activity
    Properties:
        Name: ActivityWithKmsEncryption
        EncryptionConfiguration:
            Type: CUSTOMER_MANAGED_KMS_KEY
            KmsKeyId: !Ref MyKmsKey
            KmsDataKeyReusePeriodSeconds: 100
        Tags:
          -
            Key: "keyname1"
            Value: "value1"
          -
            Key: "keyname2"
            Value: "value2"

    MyKmsKey:
        Type: AWS::KMS::Key
        Properties:
            Description: Symmetric KMS key used for encryption/decryption
```

# AWS::StepFunctions::Activity EncryptionConfiguration
<a name="aws-properties-stepfunctions-activity-encryptionconfiguration"></a>

Settings to configure server-side encryption for an activity. By default, Step Functions provides transparent server-side encryption. With this configuration, you can specify a customer managed AWS KMS key for encryption.

## Syntax
<a name="aws-properties-stepfunctions-activity-encryptionconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-activity-encryptionconfiguration-syntax.json"></a>

```
{
  "[KmsDataKeyReusePeriodSeconds](#cfn-stepfunctions-activity-encryptionconfiguration-kmsdatakeyreuseperiodseconds)" : Integer,
  "[KmsKeyId](#cfn-stepfunctions-activity-encryptionconfiguration-kmskeyid)" : String,
  "[Type](#cfn-stepfunctions-activity-encryptionconfiguration-type)" : String
}
```

### YAML
<a name="aws-properties-stepfunctions-activity-encryptionconfiguration-syntax.yaml"></a>

```
  [KmsDataKeyReusePeriodSeconds](#cfn-stepfunctions-activity-encryptionconfiguration-kmsdatakeyreuseperiodseconds): Integer
  [KmsKeyId](#cfn-stepfunctions-activity-encryptionconfiguration-kmskeyid): String
  [Type](#cfn-stepfunctions-activity-encryptionconfiguration-type): String
```

## Properties
<a name="aws-properties-stepfunctions-activity-encryptionconfiguration-properties"></a>

`KmsDataKeyReusePeriodSeconds`  <a name="cfn-stepfunctions-activity-encryptionconfiguration-kmsdatakeyreuseperiodseconds"></a>
Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call `GenerateDataKey`. Only applies to customer managed keys.  
*Required*: No  
*Type*: Integer  
*Minimum*: `60`  
*Maximum*: `900`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`KmsKeyId`  <a name="cfn-stepfunctions-activity-encryptionconfiguration-kmskeyid"></a>
An alias, alias ARN, key ID, or key ARN of a symmetric encryption AWS KMS key to encrypt data. To specify a AWS KMS key in a different AWS account, you must use the key ARN or alias ARN.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Type`  <a name="cfn-stepfunctions-activity-encryptionconfiguration-type"></a>
Encryption option for an activity.   
*Required*: Yes  
*Type*: String  
*Allowed values*: `CUSTOMER_MANAGED_KMS_KEY | AWS_OWNED_KEY`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::StepFunctions::Activity TagsEntry
<a name="aws-properties-stepfunctions-activity-tagsentry"></a>

The `TagsEntry` property specifies *tags* to identify an activity.

## Syntax
<a name="aws-properties-stepfunctions-activity-tagsentry-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-activity-tagsentry-syntax.json"></a>

```
{
  "[Key](#cfn-stepfunctions-activity-tagsentry-key)" : String,
  "[Value](#cfn-stepfunctions-activity-tagsentry-value)" : String
}
```

### YAML
<a name="aws-properties-stepfunctions-activity-tagsentry-syntax.yaml"></a>

```
  [Key](#cfn-stepfunctions-activity-tagsentry-key): String
  [Value](#cfn-stepfunctions-activity-tagsentry-value): String
```

## Properties
<a name="aws-properties-stepfunctions-activity-tagsentry-properties"></a>

`Key`  <a name="cfn-stepfunctions-activity-tagsentry-key"></a>
The `key` for a key-value pair in a tag entry.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-stepfunctions-activity-tagsentry-value"></a>
The `value` for a key-value pair in a tag entry.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachine
<a name="aws-resource-stepfunctions-statemachine"></a>

Provisions a state machine. A state machine consists of a collection of states that can do work (`Task` states), determine to which states to transition next (`Choice` states), stop an execution with an error (`Fail` states), and so on. State machines are specified using a JSON-based, structured language.

## Syntax
<a name="aws-resource-stepfunctions-statemachine-syntax"></a>

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

### JSON
<a name="aws-resource-stepfunctions-statemachine-syntax.json"></a>

```
{
  "Type" : "AWS::StepFunctions::StateMachine",
  "Properties" : {
      "[Definition](#cfn-stepfunctions-statemachine-definition)" : Json,
      "[DefinitionS3Location](#cfn-stepfunctions-statemachine-definitions3location)" : S3Location,
      "[DefinitionString](#cfn-stepfunctions-statemachine-definitionstring)" : String,
      "[DefinitionSubstitutions](#cfn-stepfunctions-statemachine-definitionsubstitutions)" : {Key: Value, ...},
      "[EncryptionConfiguration](#cfn-stepfunctions-statemachine-encryptionconfiguration)" : EncryptionConfiguration,
      "[LoggingConfiguration](#cfn-stepfunctions-statemachine-loggingconfiguration)" : LoggingConfiguration,
      "[RoleArn](#cfn-stepfunctions-statemachine-rolearn)" : String,
      "[StateMachineName](#cfn-stepfunctions-statemachine-statemachinename)" : String,
      "[StateMachineType](#cfn-stepfunctions-statemachine-statemachinetype)" : String,
      "[Tags](#cfn-stepfunctions-statemachine-tags)" : [ TagsEntry, ... ],
      "[TracingConfiguration](#cfn-stepfunctions-statemachine-tracingconfiguration)" : TracingConfiguration
    }
}
```

### YAML
<a name="aws-resource-stepfunctions-statemachine-syntax.yaml"></a>

```
Type: AWS::StepFunctions::StateMachine
Properties:
  [Definition](#cfn-stepfunctions-statemachine-definition): Json
  [DefinitionS3Location](#cfn-stepfunctions-statemachine-definitions3location): 
    S3Location
  [DefinitionString](#cfn-stepfunctions-statemachine-definitionstring): 
    String
  [DefinitionSubstitutions](#cfn-stepfunctions-statemachine-definitionsubstitutions): 
    Key: Value
  [EncryptionConfiguration](#cfn-stepfunctions-statemachine-encryptionconfiguration): 
    EncryptionConfiguration
  [LoggingConfiguration](#cfn-stepfunctions-statemachine-loggingconfiguration): 
    LoggingConfiguration
  [RoleArn](#cfn-stepfunctions-statemachine-rolearn): String
  [StateMachineName](#cfn-stepfunctions-statemachine-statemachinename): String
  [StateMachineType](#cfn-stepfunctions-statemachine-statemachinetype): String
  [Tags](#cfn-stepfunctions-statemachine-tags): 
    - TagsEntry
  [TracingConfiguration](#cfn-stepfunctions-statemachine-tracingconfiguration): 
    TracingConfiguration
```

## Properties
<a name="aws-resource-stepfunctions-statemachine-properties"></a>

`Definition`  <a name="cfn-stepfunctions-statemachine-definition"></a>
The Amazon States Language definition of the state machine. The state machine definition must be in JSON or YAML, and the format of the object must match the format of your CloudFormationtemplate file. See [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html).  
*Required*: No  
*Type*: Json  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DefinitionS3Location`  <a name="cfn-stepfunctions-statemachine-definitions3location"></a>
The name of the S3 bucket where the state machine definition is stored. The state machine definition must be a JSON or YAML file.  
*Required*: No  
*Type*: [S3Location](aws-properties-stepfunctions-statemachine-s3location.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DefinitionString`  <a name="cfn-stepfunctions-statemachine-definitionstring"></a>
The Amazon States Language definition of the state machine. The state machine definition must be in JSON. See [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html).  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1048576`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DefinitionSubstitutions`  <a name="cfn-stepfunctions-statemachine-definitionsubstitutions"></a>
A map (string to string) that specifies the mappings for placeholder variables in the state machine definition. This enables the customer to inject values obtained at runtime, for example from intrinsic functions, in the state machine definition. Variables can be template parameter names, resource logical IDs, resource attributes, or a variable in a key-value map.   
Substitutions must follow the syntax: `${key_name}` or `${variable_1,variable_2,...}`.  
*Required*: No  
*Type*: Object  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EncryptionConfiguration`  <a name="cfn-stepfunctions-statemachine-encryptionconfiguration"></a>
Encryption configuration for the state machine.  
*Required*: No  
*Type*: [EncryptionConfiguration](aws-properties-stepfunctions-statemachine-encryptionconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LoggingConfiguration`  <a name="cfn-stepfunctions-statemachine-loggingconfiguration"></a>
Defines what execution history events are logged and where they are logged.  
By default, the `level` is set to `OFF`. For more information see [Log Levels](https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html) in the AWS Step Functions User Guide.
*Required*: No  
*Type*: [LoggingConfiguration](aws-properties-stepfunctions-statemachine-loggingconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RoleArn`  <a name="cfn-stepfunctions-statemachine-rolearn"></a>
The Amazon Resource Name (ARN) of the IAM role to use for this state machine.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StateMachineName`  <a name="cfn-stepfunctions-statemachine-statemachinename"></a>
The name of the state machine.   
A name must *not* contain:  
+ white space
+ brackets `< > { } [ ]`
+ wildcard characters `? *`
+ special characters `" # % \ ^ | ~ ` $ & , ; : /`
+ control characters (`U+0000-001F`, `U+007F-009F`)
If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. 
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `80`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`StateMachineType`  <a name="cfn-stepfunctions-statemachine-statemachinetype"></a>
Determines whether a `STANDARD` or `EXPRESS` state machine is created. The default is `STANDARD`. You cannot update the `type` of a state machine once it has been created. For more information on `STANDARD` and `EXPRESS` workflows, see [Standard Versus Express Workflows](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html) in the AWS Step Functions Developer Guide.  
*Required*: No  
*Type*: String  
*Allowed values*: `STANDARD | EXPRESS`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Tags`  <a name="cfn-stepfunctions-statemachine-tags"></a>
The list of tags to add to a resource.  
Tags may only contain Unicode letters, digits, white space, or these symbols: `_ . : / = + - @`.  
*Required*: No  
*Type*: Array of [TagsEntry](aws-properties-stepfunctions-statemachine-tagsentry.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TracingConfiguration`  <a name="cfn-stepfunctions-statemachine-tracingconfiguration"></a>
Selects whether or not the state machine's AWS X-Ray tracing is enabled.  
*Required*: No  
*Type*: [TracingConfiguration](aws-properties-stepfunctions-statemachine-tracingconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-stepfunctions-statemachine-return-values"></a>

### Ref
<a name="aws-resource-stepfunctions-statemachine-return-values-ref"></a>

When you provide the logical ID of this resource to the Ref intrinsic function, Ref returns the ARN of the created state machine. For example:

 `{ "Ref": "MyStateMachine" }` 

Returns a value similar to the following:

 `arn:aws:states:us-east-1:111122223333:stateMachine:HelloWorld-StateMachine` 

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

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

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

#### 
<a name="aws-resource-stepfunctions-statemachine-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
Returns the ARN of the resource.

`Name`  <a name="Name-fn::getatt"></a>
Returns the name of the state machine. For example:  
 `{ "Fn::GetAtt": ["MyStateMachine", "Name"] }`   
Returns the name of your state machine:  
 `HelloWorld-StateMachine`   
If you did not specify the name it will be similar to the following:  
 `MyStateMachine-1234abcdefgh`   
For more information about using `Fn::GetAtt`, see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).

`StateMachineRevisionId`  <a name="StateMachineRevisionId-fn::getatt"></a>
Identifier for a state machine revision, which is an immutable, read-only snapshot of a state machine’s definition and configuration.

## Examples
<a name="aws-resource-stepfunctions-statemachine--examples"></a>

The following examples create a Step Functions state machine.

**Topics**
+ [Using a Single-Line Property](#aws-resource-stepfunctions-statemachine--examples--Using_a_Single-Line_Property)
+ [Using the Fn::Join Intrinsic Function](#aws-resource-stepfunctions-statemachine--examples--Using_the_Fn::Join_Intrinsic_Function)
+ [Including Tags](#aws-resource-stepfunctions-statemachine--examples--Including_Tags)
+ [Using DefinitionSubstitutions](#aws-resource-stepfunctions-statemachine--examples--Using_DefinitionSubstitutions)
+ [hello\$1world.json](#aws-resource-stepfunctions-statemachine--examples--hello_world.json)

### Using a Single-Line Property
<a name="aws-resource-stepfunctions-statemachine--examples--Using_a_Single-Line_Property"></a>

#### JSON
<a name="aws-resource-stepfunctions-statemachine--examples--Using_a_Single-Line_Property--json"></a>

```
{  
   "AWSTemplateFormatVersion":"2010-09-09",
   "Description":"An example template for a Step Functions state machine.",
   "Resources":{  
      "MyStateMachine":{  
         "Type":"AWS::StepFunctions::StateMachine",
         "Properties":{  
            "StateMachineName":"HelloWorld-StateMachine",
            "StateMachineType":"STANDARD",
            "DefinitionString":"{\"StartAt\": \"HelloWorld\", 
            \"States\": {\"HelloWorld\": {\"Type\": \"Task\", \"Resource\": 
            \"arn:aws:lambda:us-east-1:111122223333;:function:HelloFunction\", \"End\": true}}}",
            "RoleArn":"arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1;"
         }
      }
   }
}
```

### Using the Fn::Join Intrinsic Function
<a name="aws-resource-stepfunctions-statemachine--examples--Using_the_Fn::Join_Intrinsic_Function"></a>

#### JSON
<a name="aws-resource-stepfunctions-statemachine--examples--Using_the_Fn::Join_Intrinsic_Function--json"></a>

```
{
    "AWSTemplateFormatVersion" : "2010-09-09",
    "Description" : "An example template for a Step Functions state machine.",
    "Resources": {
       "MyStateMachine": {
          "Type": "AWS::StepFunctions::StateMachine",
             "Properties": {
                "StateMachineName" : "HelloWorld-StateMachine",
                "StateMachineType":"STANDARD",
                "DefinitionString" : {
                   "Fn::Join": [
                      "\n",
                      [
                         "{",
                         "    \"StartAt\": \"HelloWorld\",",
                         "    \"States\" : {",
                         "        \"HelloWorld\" : {",
                         "            \"Type\" : \"Task\", ",
                         "            \"Resource\" : \"arn:aws:lambda:us-east-1:111122223333:function:HelloFunction\",",
                         "            \"End\" : true",
                         "        }",
                         "    }",
                         "}"
                      ]
                   ]
                },
   	      "RoleArn" : "arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1",
            "Tags": [
                    {
                        "Key": "keyname1",
                        "Value": "value1"
                    },
                    {
                        "Key": "keyname2",
                        "Value": "value2"
                    }
                ] 
            }
        }
    }
}
```

### Including Tags
<a name="aws-resource-stepfunctions-statemachine--examples--Including_Tags"></a>

#### YAML
<a name="aws-resource-stepfunctions-statemachine--examples--Including_Tags--yaml"></a>

```
AWSTemplateFormatVersion: '2010-09-09'
Description: An example template for a Step Functions state machine.
Resources:
  MyStateMachine:
    Type: AWS::StepFunctions::StateMachine
    Properties:
      StateMachineName: HelloWorld-StateMachine
      DefinitionString: |-
        {
          "StartAt": "HelloWorld",
          "States": {
            "HelloWorld": {
              "Type": "Task",
              "Resource": "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
              "End": true
            }
          }
        }
      RoleArn: arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1
      Tags:
        -
          Key: "keyname1"
          Value: "value1"
        -
          Key: "keyname2"
          Value: "value2"
```

### Using DefinitionSubstitutions
<a name="aws-resource-stepfunctions-statemachine--examples--Using_DefinitionSubstitutions"></a>

In this example template, `HelloFunction:` is defined for the `DefinitionSubstitutions` property. In the `hello_world.json` definition file, that follows`${HelloFunction}` will be replaced by `arn:aws:lambda:us-east-1:111122223333:function:HelloFunction`.

#### YAML
<a name="aws-resource-stepfunctions-statemachine--examples--Using_DefinitionSubstitutions--yaml"></a>

```
AWSTemplateFormatVersion: "2010-09-09"
Description: An example template for a Step Functions state machine.
Resources:
  MyStateMachine:
    Type: AWS::StepFunctions::StateMachine
    Properties:
      StateMachineName: HelloWorld-StateMachine
      DefinitionS3Location:
        Bucket: example_bucket
        Key: hello_world.json
      DefinitionSubstitutions:
        HelloFunction: arn:aws:lambda:us-east-1:111122223333:function:HelloFunction
      RoleArn: arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1
```

### hello\$1world.json
<a name="aws-resource-stepfunctions-statemachine--examples--hello_world.json"></a>

 A definition file where `${HelloFunction}` will be replaced by `arn:aws:lambda:us-east-1:111122223333:function:HelloFunction`. from the preceding example template.

#### JSON
<a name="aws-resource-stepfunctions-statemachine--examples--hello_world.json--json"></a>

```
{
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "${HelloFunction}",
      "End": true
    }
  }
}
```

# AWS::StepFunctions::StateMachine CloudWatchLogsLogGroup
<a name="aws-properties-stepfunctions-statemachine-cloudwatchlogsloggroup"></a>

Defines a CloudWatch log group.

**Note**  
For more information see [Standard Versus Express Workflows](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html) in the AWS Step Functions Developer Guide.

## Syntax
<a name="aws-properties-stepfunctions-statemachine-cloudwatchlogsloggroup-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachine-cloudwatchlogsloggroup-syntax.json"></a>

```
{
  "[LogGroupArn](#cfn-stepfunctions-statemachine-cloudwatchlogsloggroup-loggrouparn)" : String
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachine-cloudwatchlogsloggroup-syntax.yaml"></a>

```
  [LogGroupArn](#cfn-stepfunctions-statemachine-cloudwatchlogsloggroup-loggrouparn): String
```

## Properties
<a name="aws-properties-stepfunctions-statemachine-cloudwatchlogsloggroup-properties"></a>

`LogGroupArn`  <a name="cfn-stepfunctions-statemachine-cloudwatchlogsloggroup-loggrouparn"></a>
The ARN of the the CloudWatch log group to which you want your logs emitted to. The ARN must end with `:*`  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachine EncryptionConfiguration
<a name="aws-properties-stepfunctions-statemachine-encryptionconfiguration"></a>

Settings to configure server-side encryption for a state machine. By default, Step Functions provides transparent server-side encryption. With this configuration, you can specify a customer managed AWS KMS key for encryption.

## Syntax
<a name="aws-properties-stepfunctions-statemachine-encryptionconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachine-encryptionconfiguration-syntax.json"></a>

```
{
  "[KmsDataKeyReusePeriodSeconds](#cfn-stepfunctions-statemachine-encryptionconfiguration-kmsdatakeyreuseperiodseconds)" : Integer,
  "[KmsKeyId](#cfn-stepfunctions-statemachine-encryptionconfiguration-kmskeyid)" : String,
  "[Type](#cfn-stepfunctions-statemachine-encryptionconfiguration-type)" : String
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachine-encryptionconfiguration-syntax.yaml"></a>

```
  [KmsDataKeyReusePeriodSeconds](#cfn-stepfunctions-statemachine-encryptionconfiguration-kmsdatakeyreuseperiodseconds): Integer
  [KmsKeyId](#cfn-stepfunctions-statemachine-encryptionconfiguration-kmskeyid): String
  [Type](#cfn-stepfunctions-statemachine-encryptionconfiguration-type): String
```

## Properties
<a name="aws-properties-stepfunctions-statemachine-encryptionconfiguration-properties"></a>

`KmsDataKeyReusePeriodSeconds`  <a name="cfn-stepfunctions-statemachine-encryptionconfiguration-kmsdatakeyreuseperiodseconds"></a>
Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call `GenerateDataKey`. Only applies to customer managed keys.  
*Required*: No  
*Type*: Integer  
*Minimum*: `60`  
*Maximum*: `900`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`KmsKeyId`  <a name="cfn-stepfunctions-statemachine-encryptionconfiguration-kmskeyid"></a>
An alias, alias ARN, key ID, or key ARN of a symmetric encryption AWS KMS key to encrypt data. To specify a AWS KMS key in a different AWS account, you must use the key ARN or alias ARN.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Type`  <a name="cfn-stepfunctions-statemachine-encryptionconfiguration-type"></a>
Encryption option for a state machine.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `CUSTOMER_MANAGED_KMS_KEY | AWS_OWNED_KEY`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachine LogDestination
<a name="aws-properties-stepfunctions-statemachine-logdestination"></a>

Defines a destination for `LoggingConfiguration`.

**Note**  
For more information on logging with `EXPRESS` workflows, see [Logging Express Workflows Using CloudWatch Logs](https://docs.aws.amazon.com/step-functions/latest/dg/cw-logs.html).

## Syntax
<a name="aws-properties-stepfunctions-statemachine-logdestination-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachine-logdestination-syntax.json"></a>

```
{
  "[CloudWatchLogsLogGroup](#cfn-stepfunctions-statemachine-logdestination-cloudwatchlogsloggroup)" : CloudWatchLogsLogGroup
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachine-logdestination-syntax.yaml"></a>

```
  [CloudWatchLogsLogGroup](#cfn-stepfunctions-statemachine-logdestination-cloudwatchlogsloggroup): 
    CloudWatchLogsLogGroup
```

## Properties
<a name="aws-properties-stepfunctions-statemachine-logdestination-properties"></a>

`CloudWatchLogsLogGroup`  <a name="cfn-stepfunctions-statemachine-logdestination-cloudwatchlogsloggroup"></a>
An object describing a CloudWatch log group. For more information, see [AWS::Logs::LogGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html) in the CloudFormation User Guide.  
*Required*: No  
*Type*: [CloudWatchLogsLogGroup](aws-properties-stepfunctions-statemachine-cloudwatchlogsloggroup.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachine LoggingConfiguration
<a name="aws-properties-stepfunctions-statemachine-loggingconfiguration"></a>

Defines what execution history events are logged and where they are logged.

Step Functions provides the log levels — `OFF`, `ALL`, `ERROR`, and `FATAL`. No event types log when set to `OFF` and all event types do when set to `ALL`.

**Note**  
By default, the `level` is set to `OFF`. For more information see [Log Levels](https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html) in the AWS Step Functions User Guide.

## Syntax
<a name="aws-properties-stepfunctions-statemachine-loggingconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachine-loggingconfiguration-syntax.json"></a>

```
{
  "[Destinations](#cfn-stepfunctions-statemachine-loggingconfiguration-destinations)" : [ LogDestination, ... ],
  "[IncludeExecutionData](#cfn-stepfunctions-statemachine-loggingconfiguration-includeexecutiondata)" : Boolean,
  "[Level](#cfn-stepfunctions-statemachine-loggingconfiguration-level)" : String
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachine-loggingconfiguration-syntax.yaml"></a>

```
  [Destinations](#cfn-stepfunctions-statemachine-loggingconfiguration-destinations): 
    - LogDestination
  [IncludeExecutionData](#cfn-stepfunctions-statemachine-loggingconfiguration-includeexecutiondata): Boolean
  [Level](#cfn-stepfunctions-statemachine-loggingconfiguration-level): String
```

## Properties
<a name="aws-properties-stepfunctions-statemachine-loggingconfiguration-properties"></a>

`Destinations`  <a name="cfn-stepfunctions-statemachine-loggingconfiguration-destinations"></a>
An array of objects that describes where your execution history events will be logged. Limited to size 1. Required, if your log level is not set to `OFF`.  
*Required*: No  
*Type*: Array of [LogDestination](aws-properties-stepfunctions-statemachine-logdestination.md)  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`IncludeExecutionData`  <a name="cfn-stepfunctions-statemachine-loggingconfiguration-includeexecutiondata"></a>
Determines whether execution data is included in your log. When set to `false`, data is excluded.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Level`  <a name="cfn-stepfunctions-statemachine-loggingconfiguration-level"></a>
Defines which category of execution history events are logged.  
*Required*: No  
*Type*: String  
*Allowed values*: `ALL | ERROR | FATAL | OFF`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachine S3Location
<a name="aws-properties-stepfunctions-statemachine-s3location"></a>

Defines the S3 bucket location where a state machine definition is stored. The state machine definition must be a JSON or YAML file.

## Syntax
<a name="aws-properties-stepfunctions-statemachine-s3location-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachine-s3location-syntax.json"></a>

```
{
  "[Bucket](#cfn-stepfunctions-statemachine-s3location-bucket)" : String,
  "[Key](#cfn-stepfunctions-statemachine-s3location-key)" : String,
  "[Version](#cfn-stepfunctions-statemachine-s3location-version)" : String
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachine-s3location-syntax.yaml"></a>

```
  [Bucket](#cfn-stepfunctions-statemachine-s3location-bucket): String
  [Key](#cfn-stepfunctions-statemachine-s3location-key): String
  [Version](#cfn-stepfunctions-statemachine-s3location-version): String
```

## Properties
<a name="aws-properties-stepfunctions-statemachine-s3location-properties"></a>

`Bucket`  <a name="cfn-stepfunctions-statemachine-s3location-bucket"></a>
The name of the S3 bucket where the state machine definition JSON or YAML file is stored.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Key`  <a name="cfn-stepfunctions-statemachine-s3location-key"></a>
The name of the state machine definition file (Amazon S3 object name).  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Version`  <a name="cfn-stepfunctions-statemachine-s3location-version"></a>
For versioning-enabled buckets, a specific version of the state machine definition.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachine TagsEntry
<a name="aws-properties-stepfunctions-statemachine-tagsentry"></a>

The `TagsEntry` property specifies *tags* to identify a state machine.

## Syntax
<a name="aws-properties-stepfunctions-statemachine-tagsentry-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachine-tagsentry-syntax.json"></a>

```
{
  "[Key](#cfn-stepfunctions-statemachine-tagsentry-key)" : String,
  "[Value](#cfn-stepfunctions-statemachine-tagsentry-value)" : String
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachine-tagsentry-syntax.yaml"></a>

```
  [Key](#cfn-stepfunctions-statemachine-tagsentry-key): String
  [Value](#cfn-stepfunctions-statemachine-tagsentry-value): String
```

## Properties
<a name="aws-properties-stepfunctions-statemachine-tagsentry-properties"></a>

`Key`  <a name="cfn-stepfunctions-statemachine-tagsentry-key"></a>
The `key` for a key-value pair in a tag entry.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-stepfunctions-statemachine-tagsentry-value"></a>
The `value` for a key-value pair in a tag entry.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachine TracingConfiguration
<a name="aws-properties-stepfunctions-statemachine-tracingconfiguration"></a>

Selects whether or not the state machine's AWS X-Ray tracing is enabled. To configure your state machine to send trace data to X-Ray, set `Enabled` to `true`.

## Syntax
<a name="aws-properties-stepfunctions-statemachine-tracingconfiguration-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachine-tracingconfiguration-syntax.json"></a>

```
{
  "[Enabled](#cfn-stepfunctions-statemachine-tracingconfiguration-enabled)" : Boolean
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachine-tracingconfiguration-syntax.yaml"></a>

```
  [Enabled](#cfn-stepfunctions-statemachine-tracingconfiguration-enabled): Boolean
```

## Properties
<a name="aws-properties-stepfunctions-statemachine-tracingconfiguration-properties"></a>

`Enabled`  <a name="cfn-stepfunctions-statemachine-tracingconfiguration-enabled"></a>
When set to `true`, X-Ray tracing is enabled.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachineAlias
<a name="aws-resource-stepfunctions-statemachinealias"></a>

Represents a state machine [alias](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html). An alias routes traffic to one or two versions of the same state machine.

You can create up to 100 aliases for each state machine.

## Syntax
<a name="aws-resource-stepfunctions-statemachinealias-syntax"></a>

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

### JSON
<a name="aws-resource-stepfunctions-statemachinealias-syntax.json"></a>

```
{
  "Type" : "AWS::StepFunctions::StateMachineAlias",
  "Properties" : {
      "[DeploymentPreference](#cfn-stepfunctions-statemachinealias-deploymentpreference)" : DeploymentPreference,
      "[Description](#cfn-stepfunctions-statemachinealias-description)" : String,
      "[Name](#cfn-stepfunctions-statemachinealias-name)" : String,
      "[RoutingConfiguration](#cfn-stepfunctions-statemachinealias-routingconfiguration)" : [ RoutingConfigurationVersion, ... ],
      "[StateMachineArn](#cfn-stepfunctions-statemachinealias-statemachinearn)" : String
    }
}
```

### YAML
<a name="aws-resource-stepfunctions-statemachinealias-syntax.yaml"></a>

```
Type: AWS::StepFunctions::StateMachineAlias
Properties:
  [DeploymentPreference](#cfn-stepfunctions-statemachinealias-deploymentpreference): 
    DeploymentPreference
  [Description](#cfn-stepfunctions-statemachinealias-description): String
  [Name](#cfn-stepfunctions-statemachinealias-name): String
  [RoutingConfiguration](#cfn-stepfunctions-statemachinealias-routingconfiguration): 
    - RoutingConfigurationVersion
  [StateMachineArn](#cfn-stepfunctions-statemachinealias-statemachinearn): String
```

## Properties
<a name="aws-resource-stepfunctions-statemachinealias-properties"></a>

`DeploymentPreference`  <a name="cfn-stepfunctions-statemachinealias-deploymentpreference"></a>
The settings that enable gradual state machine deployments. These settings include [Alarms](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachinealias-deploymentpreference.html#cfn-stepfunctions-statemachinealias-deploymentpreference-alarms), [Interval](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachinealias-deploymentpreference.html#cfn-stepfunctions-statemachinealias-deploymentpreference-interval), [Percentage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachinealias-deploymentpreference.html#cfn-stepfunctions-statemachinealias-deploymentpreference-percentage), [StateMachineVersionArn](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachinealias-deploymentpreference.html#cfn-stepfunctions-statemachinealias-deploymentpreference-statemachineversionarn), and [Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachinealias-deploymentpreference.html#cfn-stepfunctions-statemachinealias-deploymentpreference-type).  
 CloudFormation  automatically shifts traffic from the version an alias currently points to, to a new state machine version that you specify.  
`RoutingConfiguration` and `DeploymentPreference` are mutually exclusive properties. You must define only one of these properties.
Based on the type of deployment you want to perform, you can specify one of the following settings:  
+ `LINEAR` - Shifts traffic to the new version in equal increments with an equal number of minutes between each increment.

  For example, if you specify the increment percent as `20` with an interval of `600` minutes, this deployment increases traffic by 20 percent every 600 minutes until the new version receives 100 percent of the traffic. This deployment immediately rolls back the new version if any  Amazon CloudWatch  alarms are triggered.
+ `ALL_AT_ONCE` - Shifts 100 percent of traffic to the new version immediately.  CloudFormation  monitors the new version and rolls it back automatically to the previous version if any  CloudWatch  alarms are triggered.
+ `CANARY` - Shifts traffic in two increments.

  In the first increment, a small percentage of traffic, for example, 10 percent is shifted to the new version. In the second increment, before a specified time interval in seconds gets over, the remaining traffic is shifted to the new version. The shift to the new version for the remaining traffic takes place only if no  CloudWatch  alarms are triggered during the specified time interval.
*Required*: No  
*Type*: [DeploymentPreference](aws-properties-stepfunctions-statemachinealias-deploymentpreference.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Description`  <a name="cfn-stepfunctions-statemachinealias-description"></a>
An optional description of the state machine alias.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Name`  <a name="cfn-stepfunctions-statemachinealias-name"></a>
The name of the state machine alias. If you don't provide a name, it uses an automatically generated name based on the logical ID.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `80`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`RoutingConfiguration`  <a name="cfn-stepfunctions-statemachinealias-routingconfiguration"></a>
The routing configuration of an alias. Routing configuration splits [StartExecution](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html) requests between one or two versions of the same state machine.  
Use `RoutingConfiguration` if you want to explicitly set the alias [weights](https://docs.aws.amazon.com/step-functions/latest/apireference/API_RoutingConfigurationListItem.html#StepFunctions-Type-RoutingConfigurationListItem-weight). Weight is the percentage of traffic you want to route to a state machine version.  
`RoutingConfiguration` and `DeploymentPreference` are mutually exclusive properties. You must define only one of these properties.
*Required*: No  
*Type*: Array of [RoutingConfigurationVersion](aws-properties-stepfunctions-statemachinealias-routingconfigurationversion.md)  
*Minimum*: `1`  
*Maximum*: `2`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StateMachineArn`  <a name="cfn-stepfunctions-statemachinealias-statemachinearn"></a>
Property description not available.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-stepfunctions-statemachinealias-return-values"></a>

### Ref
<a name="aws-resource-stepfunctions-statemachinealias-return-values-ref"></a>

When you provide the logical ID of this resource to the `Ref` intrinsic function, `Ref` returns the ARN of the created state machine alias. For example,

```
{ "Ref": "PROD" }
```

Returns the ARN of the created state machine alias as shown in the following example.

 `arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:PROD` 

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

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

`Fn::GetAtt` returns a value for a specified attribute of this type. The following is the available attribute.

For more information about using `Fn::GetAtt`, see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-stepfunctions-statemachinealias-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
Returns the ARN of the state machine alias. For example, `arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:PROD`.

## Examples
<a name="aws-resource-stepfunctions-statemachinealias--examples"></a>

The following are examples of `LINEAR` deployment that show how you can use an alias to shift traffic to a new version. 

**Topics**
+ [Shifting traffic to a new version with an alias](#aws-resource-stepfunctions-statemachinealias--examples--Shifting_traffic_to_a_new_version_with_an_alias)
+ [Complete example to publish and deploy a new version with an alias](#aws-resource-stepfunctions-statemachinealias--examples--Complete_example_to_publish_and_deploy_a_new_version_with_an_alias)
+ [Publish and deploy a version that always points to the most recent state machine revision](#aws-resource-stepfunctions-statemachinealias--examples--Publish_and_deploy_a_version_that_always_points_to_the_most_recent_state_machine_revision)

### Shifting traffic to a new version with an alias
<a name="aws-resource-stepfunctions-statemachinealias--examples--Shifting_traffic_to_a_new_version_with_an_alias"></a>

The following example shows an alias named `PROD` that shifts 20 percent of traffic to the version B every five minutes.

#### YAML
<a name="aws-resource-stepfunctions-statemachinealias--examples--Shifting_traffic_to_a_new_version_with_an_alias--yaml"></a>

```
PROD:
  Type: AWS::StepFunctions::Alias
  Properties:
    Name: PROD
    Description: The PROD state machine alias taking production traffic.
    DeploymentPreference:
      StateMachineVersionArn: !Ref MyStateMachineVersionB
      Type: LINEAR
      Interval: 5
      Percentage: 20
      Alarms:
        # A list of alarms that you want to monitor
        - !Ref AliasErrorMetricGreaterThanZeroAlarm
        - !Ref LatestVersionErrorMetricGreaterThanZeroAlarm
```

### Complete example to publish and deploy a new version with an alias
<a name="aws-resource-stepfunctions-statemachinealias--examples--Complete_example_to_publish_and_deploy_a_new_version_with_an_alias"></a>

The following example publishes multiple versions of the same state machine with the [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html) resource. The example also creates an alias with the `AWS::StepFunctions::StateMachineAlias` resource and uses that alias to deploy a new state machine version.

#### YAML
<a name="aws-resource-stepfunctions-statemachinealias--examples--Complete_example_to_publish_and_deploy_a_new_version_with_an_alias--yaml"></a>

```
MyStateMachine:
  Type: AWS::StepFunctions::StateMachine
  Properties:
    StateMachineType: STANDARD
    StateMachineName: MyStateMachine
    RoleArn: arn:aws:iam::12345678912:role/myIamRole
    Definition:
      StartAt: PassState
      States:
        PassState:
          Type: Pass
          Result: Result
          End: true

MyStateMachineVersionA:
  Type: AWS::StepFunctions::StateMachineVersion
  Properties:
    Description: Version 1
    StateMachineArn: !Ref MyStateMachine

MyStateMachineVersionB:
  Type: AWS::StepFunctions::StateMachineVersion
  Properties:
    Description: Version 2
    StateMachineArn: !Ref MyStateMachine

PROD:
  Type: AWS::StepFunctions::StateMachineAlias
  Properties:
    Name: PROD
    Description: The PROD state machine alias taking production traffic.
    DeploymentPreference:
      StateMachineVersionArn: !Ref MyStateMachineVersionB
      Type: LINEAR
      Percentage: 20
      Interval: 5
      Alarms:
        - !Ref CloudWatchAlarm1
        - !Ref CloudWatchAlarm2
```

### Publish and deploy a version that always points to the most recent state machine revision
<a name="aws-resource-stepfunctions-statemachinealias--examples--Publish_and_deploy_a_version_that_always_points_to_the_most_recent_state_machine_revision"></a>

The following example demonstrates the use of [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html#cfn-stepfunctions-statemachineversion-statemachinerevisionid](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html#cfn-stepfunctions-statemachineversion-statemachinerevisionid) property to return the value of revision ID for the state machine resource. CloudFormation automatically detects if this property's value is different from the value in previous stack and publishes a new version that always points to the most recent revision of your state machine. The example then creates an alias named PROD to deploy this new version.

#### YAML
<a name="aws-resource-stepfunctions-statemachinealias--examples--Publish_and_deploy_a_version_that_always_points_to_the_most_recent_state_machine_revision--yaml"></a>

```
MyStateMachine:
  Type: AWS::StepFunctions::StateMachine
  Properties:
    StateMachineType: STANDARD
    StateMachineName: MyStateMachine
    RoleArn: arn:aws:iam::12345678912:role/myIamRole
    Definition:
      StartAt: PassState
      States:
        PassState:
          Type: Pass
          Result: Result
          End: true

MyStateMachineVersion:
  Type: AWS::StepFunctions::StateMachineVersion
  Properties:
    Description: Version referencing 
    StateMachineArn: !Ref MyStateMachine
    StateMachineRevisionId: !GetAtt MyStateMachine.StateMachineRevisionId

PROD:
  Type: AWS::StepFunctions::StateMachineAlias
  Properties:
    Name: PROD
    Description: The PROD state machine alias taking production traffic.
    DeploymentPreference:
      StateMachineVersionArn: !Ref MyStateMachineVersion
      Type: LINEAR
      Percentage: 20
      Interval: 5
      Alarms:
        - !Ref CloudWatchAlarm1
        - !Ref CloudWatchAlarm2
```

# AWS::StepFunctions::StateMachineAlias DeploymentPreference
<a name="aws-properties-stepfunctions-statemachinealias-deploymentpreference"></a>

Enables gradual state machine deployments.  CloudFormation  automatically shifts traffic from the version the alias currently points to, to a new state machine version that you specify.

## Syntax
<a name="aws-properties-stepfunctions-statemachinealias-deploymentpreference-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachinealias-deploymentpreference-syntax.json"></a>

```
{
  "[Alarms](#cfn-stepfunctions-statemachinealias-deploymentpreference-alarms)" : [ String, ... ],
  "[Interval](#cfn-stepfunctions-statemachinealias-deploymentpreference-interval)" : Integer,
  "[Percentage](#cfn-stepfunctions-statemachinealias-deploymentpreference-percentage)" : Integer,
  "[StateMachineVersionArn](#cfn-stepfunctions-statemachinealias-deploymentpreference-statemachineversionarn)" : String,
  "[Type](#cfn-stepfunctions-statemachinealias-deploymentpreference-type)" : String
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachinealias-deploymentpreference-syntax.yaml"></a>

```
  [Alarms](#cfn-stepfunctions-statemachinealias-deploymentpreference-alarms): 
    - String
  [Interval](#cfn-stepfunctions-statemachinealias-deploymentpreference-interval): Integer
  [Percentage](#cfn-stepfunctions-statemachinealias-deploymentpreference-percentage): Integer
  [StateMachineVersionArn](#cfn-stepfunctions-statemachinealias-deploymentpreference-statemachineversionarn): String
  [Type](#cfn-stepfunctions-statemachinealias-deploymentpreference-type): String
```

## Properties
<a name="aws-properties-stepfunctions-statemachinealias-deploymentpreference-properties"></a>

`Alarms`  <a name="cfn-stepfunctions-statemachinealias-deploymentpreference-alarms"></a>
A list of  Amazon CloudWatch  alarm names to be monitored during the deployment. The deployment fails and rolls back if any of these alarms go into the `ALARM` state.  
 Amazon CloudWatch  considers nonexistent alarms to have an `OK` state. If you provide an invalid alarm name or provide the ARN of an alarm instead of its name, your deployment may not roll back correctly.
*Required*: No  
*Type*: Array of String  
*Minimum*: `1 | 1`  
*Maximum*: `256 | 100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Interval`  <a name="cfn-stepfunctions-statemachinealias-deploymentpreference-interval"></a>
The time in minutes between each traffic shifting increment.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `2100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Percentage`  <a name="cfn-stepfunctions-statemachinealias-deploymentpreference-percentage"></a>
The percentage of traffic to shift to the new version in each increment.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `99`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StateMachineVersionArn`  <a name="cfn-stepfunctions-statemachinealias-deploymentpreference-statemachineversionarn"></a>
The Amazon Resource Name (ARN) of the [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html) resource that will be the final version to which the alias points to when the traffic shifting is complete.  
While performing gradual deployments, you can only provide a single state machine version ARN. To explicitly set version weights in a  CloudFormation  template, use `RoutingConfiguration` instead.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Type`  <a name="cfn-stepfunctions-statemachinealias-deploymentpreference-type"></a>
The type of deployment you want to perform. You can specify one of the following types:  
+ `LINEAR` - Shifts traffic to the new version in equal increments with an equal number of minutes between each increment.

  For example, if you specify the increment percent as `20` with an interval of `600` minutes, this deployment increases traffic by 20 percent every 600 minutes until the new version receives 100 percent of the traffic. This deployment immediately rolls back the new version if any  CloudWatch  alarms are triggered.
+ `ALL_AT_ONCE` - Shifts 100 percent of traffic to the new version immediately.  CloudFormation  monitors the new version and rolls it back automatically to the previous version if any  CloudWatch  alarms are triggered.
+ `CANARY` - Shifts traffic in two increments.

  In the first increment, a small percentage of traffic, for example, 10 percent is shifted to the new version. In the second increment, before a specified time interval in seconds gets over, the remaining traffic is shifted to the new version. The shift to the new version for the remaining traffic takes place only if no  CloudWatch  alarms are triggered during the specified time interval.
*Required*: Yes  
*Type*: String  
*Allowed values*: `LINEAR | ALL_AT_ONCE | CANARY`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachineAlias RoutingConfigurationVersion
<a name="aws-properties-stepfunctions-statemachinealias-routingconfigurationversion"></a>

The state machine version to which you want to route the execution traffic.

## Syntax
<a name="aws-properties-stepfunctions-statemachinealias-routingconfigurationversion-syntax"></a>

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

### JSON
<a name="aws-properties-stepfunctions-statemachinealias-routingconfigurationversion-syntax.json"></a>

```
{
  "[StateMachineVersionArn](#cfn-stepfunctions-statemachinealias-routingconfigurationversion-statemachineversionarn)" : String,
  "[Weight](#cfn-stepfunctions-statemachinealias-routingconfigurationversion-weight)" : Integer
}
```

### YAML
<a name="aws-properties-stepfunctions-statemachinealias-routingconfigurationversion-syntax.yaml"></a>

```
  [StateMachineVersionArn](#cfn-stepfunctions-statemachinealias-routingconfigurationversion-statemachineversionarn): String
  [Weight](#cfn-stepfunctions-statemachinealias-routingconfigurationversion-weight): Integer
```

## Properties
<a name="aws-properties-stepfunctions-statemachinealias-routingconfigurationversion-properties"></a>

`StateMachineVersionArn`  <a name="cfn-stepfunctions-statemachinealias-routingconfigurationversion-statemachineversionarn"></a>
The Amazon Resource Name (ARN) that identifies one or two state machine versions defined in the routing configuration.  
If you specify the ARN of a second version, it must belong to the same state machine as the first version.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Weight`  <a name="cfn-stepfunctions-statemachinealias-routingconfigurationversion-weight"></a>
The percentage of traffic you want to route to the state machine version. The sum of the weights in the routing configuration must be equal to 100.  
*Required*: Yes  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::StepFunctions::StateMachineVersion
<a name="aws-resource-stepfunctions-statemachineversion"></a>

Represents a state machine [version](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html). A published version uses the latest state machine [https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html). A revision is an immutable, read-only snapshot of a state machine’s definition and configuration.

You can publish up to 1000 versions for each state machine.

**Important**  
Before you delete a version, make sure that version's ARN isn't being referenced in any long-running workflows or application code outside of the stack.

## Syntax
<a name="aws-resource-stepfunctions-statemachineversion-syntax"></a>

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

### JSON
<a name="aws-resource-stepfunctions-statemachineversion-syntax.json"></a>

```
{
  "Type" : "AWS::StepFunctions::StateMachineVersion",
  "Properties" : {
      "[Description](#cfn-stepfunctions-statemachineversion-description)" : String,
      "[StateMachineArn](#cfn-stepfunctions-statemachineversion-statemachinearn)" : String,
      "[StateMachineRevisionId](#cfn-stepfunctions-statemachineversion-statemachinerevisionid)" : String
    }
}
```

### YAML
<a name="aws-resource-stepfunctions-statemachineversion-syntax.yaml"></a>

```
Type: AWS::StepFunctions::StateMachineVersion
Properties:
  [Description](#cfn-stepfunctions-statemachineversion-description): String
  [StateMachineArn](#cfn-stepfunctions-statemachineversion-statemachinearn): String
  [StateMachineRevisionId](#cfn-stepfunctions-statemachineversion-statemachinerevisionid): String
```

## Properties
<a name="aws-resource-stepfunctions-statemachineversion-properties"></a>

`Description`  <a name="cfn-stepfunctions-statemachineversion-description"></a>
An optional description of the state machine version.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`StateMachineArn`  <a name="cfn-stepfunctions-statemachineversion-statemachinearn"></a>
The Amazon Resource Name (ARN) of the state machine.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`StateMachineRevisionId`  <a name="cfn-stepfunctions-statemachineversion-statemachinerevisionid"></a>
Identifier for a state machine revision, which is an immutable, read-only snapshot of a state machine’s definition and configuration.  
Only publish the state machine version if the current state machine's revision ID matches the specified ID. Use this option to avoid publishing a version if the state machine has changed since you last updated it.  
To specify the initial state machine revision, set the value as `INITIAL`.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `2048`  
*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-stepfunctions-statemachineversion-return-values"></a>

### Ref
<a name="aws-resource-stepfunctions-statemachineversion-return-values-ref"></a>

When you provide the logical ID of this resource to the `Ref` intrinsic function, `Ref` returns the ARN of the published state machine version. For example, `arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:1.`

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

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

`Fn::GetAtt` returns a value for a specified attribute of this type. The following is the available attribute.

For more information about using `Fn::GetAtt`, see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-stepfunctions-statemachineversion-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
Returns the ARN of the state machine version. For example, `arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:1`.

## Examples
<a name="aws-resource-stepfunctions-statemachineversion--examples"></a>

The following CloudFormation template examples show how you can create multiple versions of the same state machine and publish a version using the latest revision of a state machine.

**Topics**
+ [Publish multiple state machine versions](#aws-resource-stepfunctions-statemachineversion--examples--Publish_multiple_state_machine_versions)
+ [Publish a version for the latest revision of a state machine](#aws-resource-stepfunctions-statemachineversion--examples--Publish_a_version_for_the_latest_revision_of_a_state_machine)

### Publish multiple state machine versions
<a name="aws-resource-stepfunctions-statemachineversion--examples--Publish_multiple_state_machine_versions"></a>

#### YAML
<a name="aws-resource-stepfunctions-statemachineversion--examples--Publish_multiple_state_machine_versions--yaml"></a>

```
MyStateMachineVersionA:
  Type: AWS::StepFunctions::StateMachineVersion
  Properties:
    Description: Version 1
    StateMachineArn: !Ref MyStateMachine

MyStateMachineVersionB:
  Type: AWS::StepFunctions::StateMachineVersion
  Properties:
    Description: Version 2
    StateMachineArn: !Ref MyStateMachine
```

### Publish a version for the latest revision of a state machine
<a name="aws-resource-stepfunctions-statemachineversion--examples--Publish_a_version_for_the_latest_revision_of_a_state_machine"></a>

The following example uses the [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html#cfn-stepfunctions-statemachineversion-statemachinerevisionid](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachineversion.html#cfn-stepfunctions-statemachineversion-statemachinerevisionid) property, which returns a unique value for revision ID of the state machine resource whenever an update is made to the state machine. CloudFormation automatically detects a different value for the `StateMachineRevisionId` property compared to the property's value in previous stack and makes a replacement update to the `AWS::StepFunctions::StateMachineVersion` resource. This publishes a new version that points to the most recent revision of your state machine.

#### YAML
<a name="aws-resource-stepfunctions-statemachineversion--examples--Publish_a_version_for_the_latest_revision_of_a_state_machine--yaml"></a>

```
MyLatestStateMachineVersion:
  Type: AWS::StepFunctions::StateMachineVersion
  Properties:
    Description: This version points to the most recent revision of a state machine.
    StateMachineArn: !Ref MyStateMachine
    StateMachineRevisionId: !GetAtt MyStateMachine.StateMachineRevisionId
```