AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

StateMachine

Define a StepFunctions State Machine.

Import

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

Or use the module namespace:

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

Properties

Configuration passed to the constructor as StateMachineProps.

commentOptional
string

Comment that describes this state machine.

Default: - No comment

definitionOptionalDeprecated
IChainable

Definition for this state machine.

Deprecated: use definitionBody: DefinitionBody.fromChainable()

definitionBodyOptional
DefinitionBody

Definition for this state machine.

definitionSubstitutionsOptional
{ [key: string]: string }

substitutions for the definition body as a key-value map.

encryptionConfigurationOptional
EncryptionConfiguration

Configures server-side encryption of the state machine definition and execution history.

Default: - data is transparently encrypted using an AWS owned key

logsOptional
LogOptions

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

Default: No logging

queryLanguageOptional
QueryLanguage

The name of the query language used by the state machine. If the state does not contain a `queryLanguage` field, then it will use the query language specified in this `queryLanguage` field.

Default: - JSON_PATH

removalPolicyOptional
RemovalPolicy

The removal policy to apply to state machine.

Default: RemovalPolicy.DESTROY

roleOptional
IRole

The execution role for the state machine service.

Default: A role is automatically created

stateMachineNameOptional
string

A name for the state machine.

Default: A name is automatically generated

stateMachineTypeOptional
StateMachineType

Type of the state machine.

Default: StateMachineType.STANDARD

timeoutOptional
Duration

Maximum run time for this state machine.

Default: No timeout

tracingEnabledOptional
boolean

Specifies whether Amazon X-Ray tracing is enabled for this state machine.

Default: false

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