aws logo
AWS Classic v5.33.0, Mar 24 23

aws.sfn.StateMachine

Provides a Step Function State Machine resource

Example Usage

Basic (Standard Workflow)

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    // ...
    var sfnStateMachine = new Aws.Sfn.StateMachine("sfnStateMachine", new()
    {
        RoleArn = aws_iam_role.Iam_for_sfn.Arn,
        Definition = @$"{{
  ""Comment"": ""A Hello World example of the Amazon States Language using an AWS Lambda Function"",
  ""StartAt"": ""HelloWorld"",
  ""States"": {{
    ""HelloWorld"": {{
      ""Type"": ""Task"",
      ""Resource"": ""{aws_lambda_function.Lambda.Arn}"",
      ""End"": true
    }}
  }}
}}
",
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/sfn"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sfn.NewStateMachine(ctx, "sfnStateMachine", &sfn.StateMachineArgs{
			RoleArn: pulumi.Any(aws_iam_role.Iam_for_sfn.Arn),
			Definition: pulumi.String(fmt.Sprintf(`{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "%v",
      "End": true
    }
  }
}
`, aws_lambda_function.Lambda.Arn)),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sfn.StateMachine;
import com.pulumi.aws.sfn.StateMachineArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var sfnStateMachine = new StateMachine("sfnStateMachine", StateMachineArgs.builder()        
            .roleArn(aws_iam_role.iam_for_sfn().arn())
            .definition("""
{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "%s",
      "End": true
    }
  }
}
", aws_lambda_function.lambda().arn()))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

# ...
sfn_state_machine = aws.sfn.StateMachine("sfnStateMachine",
    role_arn=aws_iam_role["iam_for_sfn"]["arn"],
    definition=f"""{{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {{
    "HelloWorld": {{
      "Type": "Task",
      "Resource": "{aws_lambda_function["lambda"]["arn"]}",
      "End": true
    }}
  }}
}}
""")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// ...
const sfnStateMachine = new aws.sfn.StateMachine("sfnStateMachine", {
    roleArn: aws_iam_role.iam_for_sfn.arn,
    definition: `{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "${aws_lambda_function.lambda.arn}",
      "End": true
    }
  }
}
`,
});
resources:
  # ...
  sfnStateMachine:
    type: aws:sfn:StateMachine
    properties:
      roleArn: ${aws_iam_role.iam_for_sfn.arn}
      definition: |
        {
          "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
          "StartAt": "HelloWorld",
          "States": {
            "HelloWorld": {
              "Type": "Task",
              "Resource": "${aws_lambda_function.lambda.arn}",
              "End": true
            }
          }
        }        

Basic (Express Workflow)

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    // ...
    var sfnStateMachine = new Aws.Sfn.StateMachine("sfnStateMachine", new()
    {
        RoleArn = aws_iam_role.Iam_for_sfn.Arn,
        Type = "EXPRESS",
        Definition = @$"{{
  ""Comment"": ""A Hello World example of the Amazon States Language using an AWS Lambda Function"",
  ""StartAt"": ""HelloWorld"",
  ""States"": {{
    ""HelloWorld"": {{
      ""Type"": ""Task"",
      ""Resource"": ""{aws_lambda_function.Lambda.Arn}"",
      ""End"": true
    }}
  }}
}}
",
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/sfn"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sfn.NewStateMachine(ctx, "sfnStateMachine", &sfn.StateMachineArgs{
			RoleArn: pulumi.Any(aws_iam_role.Iam_for_sfn.Arn),
			Type:    pulumi.String("EXPRESS"),
			Definition: pulumi.String(fmt.Sprintf(`{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "%v",
      "End": true
    }
  }
}
`, aws_lambda_function.Lambda.Arn)),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sfn.StateMachine;
import com.pulumi.aws.sfn.StateMachineArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var sfnStateMachine = new StateMachine("sfnStateMachine", StateMachineArgs.builder()        
            .roleArn(aws_iam_role.iam_for_sfn().arn())
            .type("EXPRESS")
            .definition("""
{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "%s",
      "End": true
    }
  }
}
", aws_lambda_function.lambda().arn()))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

# ...
sfn_state_machine = aws.sfn.StateMachine("sfnStateMachine",
    role_arn=aws_iam_role["iam_for_sfn"]["arn"],
    type="EXPRESS",
    definition=f"""{{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {{
    "HelloWorld": {{
      "Type": "Task",
      "Resource": "{aws_lambda_function["lambda"]["arn"]}",
      "End": true
    }}
  }}
}}
""")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// ...
const sfnStateMachine = new aws.sfn.StateMachine("sfnStateMachine", {
    roleArn: aws_iam_role.iam_for_sfn.arn,
    type: "EXPRESS",
    definition: `{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "${aws_lambda_function.lambda.arn}",
      "End": true
    }
  }
}
`,
});
resources:
  # ...
  sfnStateMachine:
    type: aws:sfn:StateMachine
    properties:
      roleArn: ${aws_iam_role.iam_for_sfn.arn}
      type: EXPRESS
      definition: |
        {
          "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
          "StartAt": "HelloWorld",
          "States": {
            "HelloWorld": {
              "Type": "Task",
              "Resource": "${aws_lambda_function.lambda.arn}",
              "End": true
            }
          }
        }        

Logging

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    // ...
    var sfnStateMachine = new Aws.Sfn.StateMachine("sfnStateMachine", new()
    {
        RoleArn = aws_iam_role.Iam_for_sfn.Arn,
        Definition = @$"{{
  ""Comment"": ""A Hello World example of the Amazon States Language using an AWS Lambda Function"",
  ""StartAt"": ""HelloWorld"",
  ""States"": {{
    ""HelloWorld"": {{
      ""Type"": ""Task"",
      ""Resource"": ""{aws_lambda_function.Lambda.Arn}"",
      ""End"": true
    }}
  }}
}}
",
        LoggingConfiguration = new Aws.Sfn.Inputs.StateMachineLoggingConfigurationArgs
        {
            LogDestination = $"{aws_cloudwatch_log_group.Log_group_for_sfn.Arn}:*",
            IncludeExecutionData = true,
            Level = "ERROR",
        },
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/sfn"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sfn.NewStateMachine(ctx, "sfnStateMachine", &sfn.StateMachineArgs{
			RoleArn: pulumi.Any(aws_iam_role.Iam_for_sfn.Arn),
			Definition: pulumi.String(fmt.Sprintf(`{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "%v",
      "End": true
    }
  }
}
`, aws_lambda_function.Lambda.Arn)),
			LoggingConfiguration: &sfn.StateMachineLoggingConfigurationArgs{
				LogDestination:       pulumi.String(fmt.Sprintf("%v:*", aws_cloudwatch_log_group.Log_group_for_sfn.Arn)),
				IncludeExecutionData: pulumi.Bool(true),
				Level:                pulumi.String("ERROR"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sfn.StateMachine;
import com.pulumi.aws.sfn.StateMachineArgs;
import com.pulumi.aws.sfn.inputs.StateMachineLoggingConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var sfnStateMachine = new StateMachine("sfnStateMachine", StateMachineArgs.builder()        
            .roleArn(aws_iam_role.iam_for_sfn().arn())
            .definition("""
{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "%s",
      "End": true
    }
  }
}
", aws_lambda_function.lambda().arn()))
            .loggingConfiguration(StateMachineLoggingConfigurationArgs.builder()
                .logDestination(String.format("%s:*", aws_cloudwatch_log_group.log_group_for_sfn().arn()))
                .includeExecutionData(true)
                .level("ERROR")
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

# ...
sfn_state_machine = aws.sfn.StateMachine("sfnStateMachine",
    role_arn=aws_iam_role["iam_for_sfn"]["arn"],
    definition=f"""{{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {{
    "HelloWorld": {{
      "Type": "Task",
      "Resource": "{aws_lambda_function["lambda"]["arn"]}",
      "End": true
    }}
  }}
}}
""",
    logging_configuration=aws.sfn.StateMachineLoggingConfigurationArgs(
        log_destination=f"{aws_cloudwatch_log_group['log_group_for_sfn']['arn']}:*",
        include_execution_data=True,
        level="ERROR",
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// ...
const sfnStateMachine = new aws.sfn.StateMachine("sfnStateMachine", {
    roleArn: aws_iam_role.iam_for_sfn.arn,
    definition: `{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "${aws_lambda_function.lambda.arn}",
      "End": true
    }
  }
}
`,
    loggingConfiguration: {
        logDestination: `${aws_cloudwatch_log_group.log_group_for_sfn.arn}:*`,
        includeExecutionData: true,
        level: "ERROR",
    },
});
resources:
  # ...
  sfnStateMachine:
    type: aws:sfn:StateMachine
    properties:
      roleArn: ${aws_iam_role.iam_for_sfn.arn}
      definition: |
        {
          "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
          "StartAt": "HelloWorld",
          "States": {
            "HelloWorld": {
              "Type": "Task",
              "Resource": "${aws_lambda_function.lambda.arn}",
              "End": true
            }
          }
        }        
      loggingConfiguration:
        logDestination: ${aws_cloudwatch_log_group.log_group_for_sfn.arn}:*
        includeExecutionData: true
        level: ERROR

Create StateMachine Resource

new StateMachine(name: string, args: StateMachineArgs, opts?: CustomResourceOptions);
@overload
def StateMachine(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 definition: Optional[str] = None,
                 logging_configuration: Optional[StateMachineLoggingConfigurationArgs] = None,
                 name: Optional[str] = None,
                 name_prefix: Optional[str] = None,
                 role_arn: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 tracing_configuration: Optional[StateMachineTracingConfigurationArgs] = None,
                 type: Optional[str] = None)
@overload
def StateMachine(resource_name: str,
                 args: StateMachineArgs,
                 opts: Optional[ResourceOptions] = None)
func NewStateMachine(ctx *Context, name string, args StateMachineArgs, opts ...ResourceOption) (*StateMachine, error)
public StateMachine(string name, StateMachineArgs args, CustomResourceOptions? opts = null)
public StateMachine(String name, StateMachineArgs args)
public StateMachine(String name, StateMachineArgs args, CustomResourceOptions options)
type: aws:sfn:StateMachine
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args StateMachineArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args StateMachineArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args StateMachineArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args StateMachineArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args StateMachineArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

StateMachine Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The StateMachine resource accepts the following input properties:

Definition string

The Amazon States Language definition of the state machine.

RoleArn string

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

LoggingConfiguration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

Name string

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

NamePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

Tags Dictionary<string, string>

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TracingConfiguration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

Type 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. Valid values: STANDARD, EXPRESS.

Definition string

The Amazon States Language definition of the state machine.

RoleArn string

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

LoggingConfiguration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

Name string

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

NamePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

Tags map[string]string

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TracingConfiguration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

Type 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. Valid values: STANDARD, EXPRESS.

definition String

The Amazon States Language definition of the state machine.

roleArn String

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

loggingConfiguration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

name String

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

namePrefix String

Creates a unique name beginning with the specified prefix. Conflicts with name.

tags Map<String,String>

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tracingConfiguration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

type 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. Valid values: STANDARD, EXPRESS.

definition string

The Amazon States Language definition of the state machine.

roleArn string

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

loggingConfiguration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

name string

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

namePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

tags {[key: string]: string}

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tracingConfiguration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

type 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. Valid values: STANDARD, EXPRESS.

definition str

The Amazon States Language definition of the state machine.

role_arn str

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

logging_configuration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

name str

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

name_prefix str

Creates a unique name beginning with the specified prefix. Conflicts with name.

tags Mapping[str, str]

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tracing_configuration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

type str

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. Valid values: STANDARD, EXPRESS.

definition String

The Amazon States Language definition of the state machine.

roleArn String

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

loggingConfiguration Property Map

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

name String

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

namePrefix String

Creates a unique name beginning with the specified prefix. Conflicts with name.

tags Map<String>

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tracingConfiguration Property Map

Selects whether AWS X-Ray tracing is enabled.

type 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. Valid values: STANDARD, EXPRESS.

Outputs

All input properties are implicitly available as output properties. Additionally, the StateMachine resource produces the following output properties:

Arn string

The ARN of the state machine.

CreationDate string

The date the state machine was created.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The current status of the state machine. Either ACTIVE or DELETING.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The ARN of the state machine.

CreationDate string

The date the state machine was created.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The current status of the state machine. Either ACTIVE or DELETING.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN of the state machine.

creationDate String

The date the state machine was created.

id String

The provider-assigned unique ID for this managed resource.

status String

The current status of the state machine. Either ACTIVE or DELETING.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The ARN of the state machine.

creationDate string

The date the state machine was created.

id string

The provider-assigned unique ID for this managed resource.

status string

The current status of the state machine. Either ACTIVE or DELETING.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The ARN of the state machine.

creation_date str

The date the state machine was created.

id str

The provider-assigned unique ID for this managed resource.

status str

The current status of the state machine. Either ACTIVE or DELETING.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN of the state machine.

creationDate String

The date the state machine was created.

id String

The provider-assigned unique ID for this managed resource.

status String

The current status of the state machine. Either ACTIVE or DELETING.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up Existing StateMachine Resource

Get an existing StateMachine resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: StateMachineState, opts?: CustomResourceOptions): StateMachine
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        creation_date: Optional[str] = None,
        definition: Optional[str] = None,
        logging_configuration: Optional[StateMachineLoggingConfigurationArgs] = None,
        name: Optional[str] = None,
        name_prefix: Optional[str] = None,
        role_arn: Optional[str] = None,
        status: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        tracing_configuration: Optional[StateMachineTracingConfigurationArgs] = None,
        type: Optional[str] = None) -> StateMachine
func GetStateMachine(ctx *Context, name string, id IDInput, state *StateMachineState, opts ...ResourceOption) (*StateMachine, error)
public static StateMachine Get(string name, Input<string> id, StateMachineState? state, CustomResourceOptions? opts = null)
public static StateMachine get(String name, Output<String> id, StateMachineState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string

The ARN of the state machine.

CreationDate string

The date the state machine was created.

Definition string

The Amazon States Language definition of the state machine.

LoggingConfiguration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

Name string

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

NamePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

RoleArn string

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

Status string

The current status of the state machine. Either ACTIVE or DELETING.

Tags Dictionary<string, string>

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

TracingConfiguration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

Type 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. Valid values: STANDARD, EXPRESS.

Arn string

The ARN of the state machine.

CreationDate string

The date the state machine was created.

Definition string

The Amazon States Language definition of the state machine.

LoggingConfiguration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

Name string

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

NamePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

RoleArn string

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

Status string

The current status of the state machine. Either ACTIVE or DELETING.

Tags map[string]string

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

TracingConfiguration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

Type 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. Valid values: STANDARD, EXPRESS.

arn String

The ARN of the state machine.

creationDate String

The date the state machine was created.

definition String

The Amazon States Language definition of the state machine.

loggingConfiguration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

name String

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

namePrefix String

Creates a unique name beginning with the specified prefix. Conflicts with name.

roleArn String

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

status String

The current status of the state machine. Either ACTIVE or DELETING.

tags Map<String,String>

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

tracingConfiguration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

type 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. Valid values: STANDARD, EXPRESS.

arn string

The ARN of the state machine.

creationDate string

The date the state machine was created.

definition string

The Amazon States Language definition of the state machine.

loggingConfiguration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

name string

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

namePrefix string

Creates a unique name beginning with the specified prefix. Conflicts with name.

roleArn string

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

status string

The current status of the state machine. Either ACTIVE or DELETING.

tags {[key: string]: string}

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

tracingConfiguration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

type 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. Valid values: STANDARD, EXPRESS.

arn str

The ARN of the state machine.

creation_date str

The date the state machine was created.

definition str

The Amazon States Language definition of the state machine.

logging_configuration StateMachineLoggingConfigurationArgs

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

name str

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

name_prefix str

Creates a unique name beginning with the specified prefix. Conflicts with name.

role_arn str

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

status str

The current status of the state machine. Either ACTIVE or DELETING.

tags Mapping[str, str]

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

tracing_configuration StateMachineTracingConfigurationArgs

Selects whether AWS X-Ray tracing is enabled.

type str

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. Valid values: STANDARD, EXPRESS.

arn String

The ARN of the state machine.

creationDate String

The date the state machine was created.

definition String

The Amazon States Language definition of the state machine.

loggingConfiguration Property Map

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

name String

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

namePrefix String

Creates a unique name beginning with the specified prefix. Conflicts with name.

roleArn String

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

status String

The current status of the state machine. Either ACTIVE or DELETING.

tags Map<String>

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

tracingConfiguration Property Map

Selects whether AWS X-Ray tracing is enabled.

type 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. Valid values: STANDARD, EXPRESS.

Supporting Types

StateMachineLoggingConfiguration

IncludeExecutionData bool

Determines whether execution data is included in your log. When set to false, data is excluded.

Level string

Defines which category of execution history events are logged. Valid values: ALL, ERROR, FATAL, OFF

LogDestination string

Amazon Resource Name (ARN) of a CloudWatch log group. Make sure the State Machine has the correct IAM policies for logging. The ARN must end with :*

IncludeExecutionData bool

Determines whether execution data is included in your log. When set to false, data is excluded.

Level string

Defines which category of execution history events are logged. Valid values: ALL, ERROR, FATAL, OFF

LogDestination string

Amazon Resource Name (ARN) of a CloudWatch log group. Make sure the State Machine has the correct IAM policies for logging. The ARN must end with :*

includeExecutionData Boolean

Determines whether execution data is included in your log. When set to false, data is excluded.

level String

Defines which category of execution history events are logged. Valid values: ALL, ERROR, FATAL, OFF

logDestination String

Amazon Resource Name (ARN) of a CloudWatch log group. Make sure the State Machine has the correct IAM policies for logging. The ARN must end with :*

includeExecutionData boolean

Determines whether execution data is included in your log. When set to false, data is excluded.

level string

Defines which category of execution history events are logged. Valid values: ALL, ERROR, FATAL, OFF

logDestination string

Amazon Resource Name (ARN) of a CloudWatch log group. Make sure the State Machine has the correct IAM policies for logging. The ARN must end with :*

include_execution_data bool

Determines whether execution data is included in your log. When set to false, data is excluded.

level str

Defines which category of execution history events are logged. Valid values: ALL, ERROR, FATAL, OFF

log_destination str

Amazon Resource Name (ARN) of a CloudWatch log group. Make sure the State Machine has the correct IAM policies for logging. The ARN must end with :*

includeExecutionData Boolean

Determines whether execution data is included in your log. When set to false, data is excluded.

level String

Defines which category of execution history events are logged. Valid values: ALL, ERROR, FATAL, OFF

logDestination String

Amazon Resource Name (ARN) of a CloudWatch log group. Make sure the State Machine has the correct IAM policies for logging. The ARN must end with :*

StateMachineTracingConfiguration

Enabled bool

When set to true, AWS X-Ray tracing is enabled. Make sure the State Machine has the correct IAM policies for logging. See the AWS Step Functions Developer Guide for details.

Enabled bool

When set to true, AWS X-Ray tracing is enabled. Make sure the State Machine has the correct IAM policies for logging. See the AWS Step Functions Developer Guide for details.

enabled Boolean

When set to true, AWS X-Ray tracing is enabled. Make sure the State Machine has the correct IAM policies for logging. See the AWS Step Functions Developer Guide for details.

enabled boolean

When set to true, AWS X-Ray tracing is enabled. Make sure the State Machine has the correct IAM policies for logging. See the AWS Step Functions Developer Guide for details.

enabled bool

When set to true, AWS X-Ray tracing is enabled. Make sure the State Machine has the correct IAM policies for logging. See the AWS Step Functions Developer Guide for details.

enabled Boolean

When set to true, AWS X-Ray tracing is enabled. Make sure the State Machine has the correct IAM policies for logging. See the AWS Step Functions Developer Guide for details.

Import

State Machines can be imported using the arn, e.g.,

 $ pulumi import aws:sfn/stateMachine:StateMachine foo arn:aws:states:eu-west-1:123456789098:stateMachine:bar

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.