AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::StepFunctions::StateMachine

CfnStateMachine

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.

Import

import { CfnStateMachine } from 'aws-cdk-lib/aws-stepfunctions';

Or use the module namespace:

import * as stepfunctions from 'aws-cdk-lib/aws-stepfunctions';
// stepfunctions.CfnStateMachine

Properties

Configuration passed to the constructor as CfnStateMachineProps.

roleArnRequired
string | IRoleRef

The Amazon Resource Name (ARN) of the IAM role to use for this state machine.

definitionOptional
any

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 CloudFormation template file. See [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) .

definitionS3LocationOptional
IResolvable | S3LocationProperty

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

definitionStringOptional
string | ITableRef | ITaskDefinitionRef | IFunctionRef | IVersionRef | ITopicRef | IQueueRef

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

definitionSubstitutionsOptional
{ [key: string]: string } | IResolvable

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,...}` .

encryptionConfigurationOptional
IResolvable | EncryptionConfigurationProperty

Encryption configuration for the state machine.

loggingConfigurationOptional
IResolvable | LoggingConfigurationProperty

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.

stateMachineNameOptional
string

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.

stateMachineTypeOptional
string

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.

tagsOptional
TagsEntryProperty[]

The list of tags to add to a resource. Tags may only contain Unicode letters, digits, white space, or these symbols: `_ . : / = + -

tracingConfigurationOptional
IResolvable | TracingConfigurationProperty

Selects whether or not the state machine's AWS X-Ray tracing is enabled.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the AWS Step Functions Cheat Sheet

Everything you need to know about AWS Step Functions on one page. HD quality, print-friendly.

Download Free Infographic