# CfnStateMachineProps

Properties for defining a `CfnStateMachine`.

Used as props by: [CfnStateMachine](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.CfnStateMachine.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';

declare const definition: any;
const cfnStateMachineProps: stepfunctions.CfnStateMachineProps = {
  roleArn: 'roleArn',

  // the properties below are optional
  definition: definition,
  definitionS3Location: {
    bucket: 'bucket',
    key: 'key',

    // the properties below are optional
    version: 'version',
  },
  definitionString: 'definitionString',
  definitionSubstitutions: {
    definitionSubstitutionsKey: 'definitionSubstitutions',
  },
  encryptionConfiguration: {
    type: 'type',

    // the properties below are optional
    kmsDataKeyReusePeriodSeconds: 123,
    kmsKeyId: 'kmsKeyId',
  },
  loggingConfiguration: {
    destinations: [{
      cloudWatchLogsLogGroup: {
        logGroupArn: 'logGroupArn',
      },
    }],
    includeExecutionData: false,
    level: 'level',
  },
  stateMachineName: 'stateMachineName',
  stateMachineType: 'stateMachineType',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  tracingConfiguration: {
    enabled: false,
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_stepfunctions as stepfunctions

# definition: Any

cfn_state_machine_props = stepfunctions.CfnStateMachineProps(
    role_arn="roleArn",

    # the properties below are optional
    definition=definition,
    definition_s3_location=stepfunctions.CfnStateMachine.S3LocationProperty(
        bucket="bucket",
        key="key",

        # the properties below are optional
        version="version"
    ),
    definition_string="definitionString",
    definition_substitutions={
        "definition_substitutions_key": "definitionSubstitutions"
    },
    encryption_configuration=stepfunctions.CfnStateMachine.EncryptionConfigurationProperty(
        type="type",

        # the properties below are optional
        kms_data_key_reuse_period_seconds=123,
        kms_key_id="kmsKeyId"
    ),
    logging_configuration=stepfunctions.CfnStateMachine.LoggingConfigurationProperty(
        destinations=[stepfunctions.CfnStateMachine.LogDestinationProperty(
            cloud_watch_logs_log_group=stepfunctions.CfnStateMachine.CloudWatchLogsLogGroupProperty(
                log_group_arn="logGroupArn"
            )
        )],
        include_execution_data=False,
        level="level"
    ),
    state_machine_name="stateMachineName",
    state_machine_type="stateMachineType",
    tags=[stepfunctions.CfnStateMachine.TagsEntryProperty(
        key="key",
        value="value"
    )],
    tracing_configuration=stepfunctions.CfnStateMachine.TracingConfigurationProperty(
        enabled=False
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.stepfunctions.*;

Object definition;

CfnStateMachineProps cfnStateMachineProps = CfnStateMachineProps.builder()
        .roleArn("roleArn")

        // the properties below are optional
        .definition(definition)
        .definitionS3Location(S3LocationProperty.builder()
                .bucket("bucket")
                .key("key")

                // the properties below are optional
                .version("version")
                .build())
        .definitionString("definitionString")
        .definitionSubstitutions(Map.of(
                "definitionSubstitutionsKey", "definitionSubstitutions"))
        .encryptionConfiguration(EncryptionConfigurationProperty.builder()
                .type("type")

                // the properties below are optional
                .kmsDataKeyReusePeriodSeconds(123)
                .kmsKeyId("kmsKeyId")
                .build())
        .loggingConfiguration(LoggingConfigurationProperty.builder()
                .destinations(List.of(LogDestinationProperty.builder()
                        .cloudWatchLogsLogGroup(CloudWatchLogsLogGroupProperty.builder()
                                .logGroupArn("logGroupArn")
                                .build())
                        .build()))
                .includeExecutionData(false)
                .level("level")
                .build())
        .stateMachineName("stateMachineName")
        .stateMachineType("stateMachineType")
        .tags(List.of(TagsEntryProperty.builder()
                .key("key")
                .value("value")
                .build()))
        .tracingConfiguration(TracingConfigurationProperty.builder()
                .enabled(false)
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.StepFunctions;

var definition;

var cfnStateMachineProps = new CfnStateMachineProps {
    RoleArn = "roleArn",

    // the properties below are optional
    Definition = definition,
    DefinitionS3Location = new S3LocationProperty {
        Bucket = "bucket",
        Key = "key",

        // the properties below are optional
        Version = "version"
    },
    DefinitionString = "definitionString",
    DefinitionSubstitutions = new Dictionary<string, string> {
        { "definitionSubstitutionsKey", "definitionSubstitutions" }
    },
    EncryptionConfiguration = new EncryptionConfigurationProperty {
        Type = "type",

        // the properties below are optional
        KmsDataKeyReusePeriodSeconds = 123,
        KmsKeyId = "kmsKeyId"
    },
    LoggingConfiguration = new LoggingConfigurationProperty {
        Destinations = new [] { new LogDestinationProperty {
            CloudWatchLogsLogGroup = new CloudWatchLogsLogGroupProperty {
                LogGroupArn = "logGroupArn"
            }
        } },
        IncludeExecutionData = false,
        Level = "level"
    },
    StateMachineName = "stateMachineName",
    StateMachineType = "stateMachineType",
    Tags = new [] { new TagsEntryProperty {
        Key = "key",
        Value = "value"
    } },
    TracingConfiguration = new TracingConfigurationProperty {
        Enabled = false
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var definition interface{}

cfnStateMachineProps := &CfnStateMachineProps{
	RoleArn: jsii.String("roleArn"),

	// the properties below are optional
	Definition: definition,
	DefinitionS3Location: &S3LocationProperty{
		Bucket: jsii.String("bucket"),
		Key: jsii.String("key"),

		// the properties below are optional
		Version: jsii.String("version"),
	},
	DefinitionString: jsii.String("definitionString"),
	DefinitionSubstitutions: map[string]*string{
		"definitionSubstitutionsKey": jsii.String("definitionSubstitutions"),
	},
	EncryptionConfiguration: &EncryptionConfigurationProperty{
		Type: jsii.String("type"),

		// the properties below are optional
		KmsDataKeyReusePeriodSeconds: jsii.Number(123),
		KmsKeyId: jsii.String("kmsKeyId"),
	},
	LoggingConfiguration: &LoggingConfigurationProperty{
		Destinations: []interface{}{
			&LogDestinationProperty{
				CloudWatchLogsLogGroup: &CloudWatchLogsLogGroupProperty{
					LogGroupArn: jsii.String("logGroupArn"),
				},
			},
		},
		IncludeExecutionData: jsii.Boolean(false),
		Level: jsii.String("level"),
	},
	StateMachineName: jsii.String("stateMachineName"),
	StateMachineType: jsii.String("stateMachineType"),
	Tags: []TagsEntryProperty{
		&TagsEntryProperty{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	TracingConfiguration: &TracingConfigurationProperty{
		Enabled: jsii.Boolean(false),
	},
}
```

## Properties

- `definition`: 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) .

- `definitionS3Location`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnStateMachine.S3LocationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.CfnStateMachine.S3LocationProperty.html) — The name of the S3 bucket where the state machine definition is stored.

  The state machine definition must be a JSON or YAML file.

- `definitionString`: string | [ITableRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_dynamodb.ITableRef.html) | [ITaskDefinitionRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ecs.ITaskDefinitionRef.html) | [IFunctionRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.IFunctionRef.html) | [IVersionRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.IVersionRef.html) | [ITopicRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_sns.ITopicRef.html) | [IQueueRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_sqs.IQueueRef.html) — 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) .

- `definitionSubstitutions`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } — 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,...}` .

- `encryptionConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnStateMachine.EncryptionConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.CfnStateMachine.EncryptionConfigurationProperty.html) — Encryption configuration for the state machine.

- `loggingConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnStateMachine.LoggingConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.CfnStateMachine.LoggingConfigurationProperty.html) — 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.

- `roleArn`: string | [IRoleRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) (required) — The Amazon Resource Name (ARN) of the IAM role to use for this state machine.

- `stateMachineName`: 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.

- `stateMachineType`: 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.

- `tags`: [CfnStateMachine.TagsEntryProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.CfnStateMachine.TagsEntryProperty.html)[] — The list of tags to add to a resource.

  Tags may only contain Unicode letters, digits, white space, or these symbols: `_ . : / = + -

- `tracingConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnStateMachine.TracingConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.CfnStateMachine.TracingConfigurationProperty.html) — Selects whether or not the state machine's AWS X-Ray tracing is enabled.
