1. Packages
  2. AWS Native
  3. API Docs
  4. stepfunctions
  5. StateMachine

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.101.0 published on Thursday, Apr 11, 2024 by Pulumi

aws-native.stepfunctions.StateMachine

Explore with Pulumi AI

aws-native logo

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.101.0 published on Thursday, Apr 11, 2024 by Pulumi

    Resource schema for StateMachine

    Example Usage

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var myStateMachine = new AwsNative.StepFunctions.StateMachine("myStateMachine", new()
        {
            StateMachineName = "HelloWorld-StateMachine",
            StateMachineType = AwsNative.StepFunctions.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;",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/stepfunctions"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := stepfunctions.NewStateMachine(ctx, "myStateMachine", &stepfunctions.StateMachineArgs{
    			StateMachineName: pulumi.String("HelloWorld-StateMachine"),
    			StateMachineType: stepfunctions.StateMachineTypeStandard,
    			DefinitionString: pulumi.String("{\"StartAt\": \"HelloWorld\",  \"States\": {\"HelloWorld\": {\"Type\": \"Task\", \"Resource\":  \"arn:aws:lambda:us-east-1:111122223333;:function:HelloFunction\", \"End\": true}}}"),
    			RoleArn:          pulumi.String("arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1;"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    my_state_machine = aws_native.stepfunctions.StateMachine("myStateMachine",
        state_machine_name="HelloWorld-StateMachine",
        state_machine_type=aws_native.stepfunctions.StateMachineType.STANDARD,
        definition_string="{\"StartAt\": \"HelloWorld\",  \"States\": {\"HelloWorld\": {\"Type\": \"Task\", \"Resource\":  \"arn:aws:lambda:us-east-1:111122223333;:function:HelloFunction\", \"End\": true}}}",
        role_arn="arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1;")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const myStateMachine = new aws_native.stepfunctions.StateMachine("myStateMachine", {
        stateMachineName: "HelloWorld-StateMachine",
        stateMachineType: aws_native.stepfunctions.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;",
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var myStateMachine = new AwsNative.StepFunctions.StateMachine("myStateMachine", new()
        {
            StateMachineName = "HelloWorld-StateMachine",
            StateMachineType = AwsNative.StepFunctions.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",
            Tags = new[]
            {
                new AwsNative.Inputs.TagArgs
                {
                    Key = "keyname1",
                    Value = "value1",
                },
                new AwsNative.Inputs.TagArgs
                {
                    Key = "keyname2",
                    Value = "value2",
                },
            },
        });
    
    });
    
    package main
    
    import (
    	awsnative "github.com/pulumi/pulumi-aws-native/sdk/go/aws"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/stepfunctions"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := stepfunctions.NewStateMachine(ctx, "myStateMachine", &stepfunctions.StateMachineArgs{
    			StateMachineName: pulumi.String("HelloWorld-StateMachine"),
    			StateMachineType: stepfunctions.StateMachineTypeStandard,
    			DefinitionString: pulumi.String(`{
        "StartAt": "HelloWorld",
        "States" : {
            "HelloWorld" : {
                "Type" : "Task", 
                "Resource" : "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
                "End" : true
            }
        }
    }`),
    			RoleArn: pulumi.String("arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1"),
    			Tags: aws.TagArray{
    				&aws.TagArgs{
    					Key:   pulumi.String("keyname1"),
    					Value: pulumi.String("value1"),
    				},
    				&aws.TagArgs{
    					Key:   pulumi.String("keyname2"),
    					Value: pulumi.String("value2"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    my_state_machine = aws_native.stepfunctions.StateMachine("myStateMachine",
        state_machine_name="HelloWorld-StateMachine",
        state_machine_type=aws_native.stepfunctions.StateMachineType.STANDARD,
        definition_string="""{
        "StartAt": "HelloWorld",
        "States" : {
            "HelloWorld" : {
                "Type" : "Task", 
                "Resource" : "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
                "End" : true
            }
        }
    }""",
        role_arn="arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1",
        tags=[
            aws_native.TagArgs(
                key="keyname1",
                value="value1",
            ),
            aws_native.TagArgs(
                key="keyname2",
                value="value2",
            ),
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const myStateMachine = new aws_native.stepfunctions.StateMachine("myStateMachine", {
        stateMachineName: "HelloWorld-StateMachine",
        stateMachineType: aws_native.stepfunctions.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",
        tags: [
            {
                key: "keyname1",
                value: "value1",
            },
            {
                key: "keyname2",
                value: "value2",
            },
        ],
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var myStateMachine = new AwsNative.StepFunctions.StateMachine("myStateMachine", new()
        {
            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 = new[]
            {
                new AwsNative.Inputs.TagArgs
                {
                    Key = "keyname1",
                    Value = "value1",
                },
                new AwsNative.Inputs.TagArgs
                {
                    Key = "keyname2",
                    Value = "value2",
                },
            },
        });
    
    });
    
    package main
    
    import (
    	awsnative "github.com/pulumi/pulumi-aws-native/sdk/go/aws"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/stepfunctions"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := stepfunctions.NewStateMachine(ctx, "myStateMachine", &stepfunctions.StateMachineArgs{
    			StateMachineName: pulumi.String("HelloWorld-StateMachine"),
    			DefinitionString: pulumi.String(`{
      "StartAt": "HelloWorld",
      "States": {
        "HelloWorld": {
          "Type": "Task",
          "Resource": "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
          "End": true
        }
      }
    }`),
    			RoleArn: pulumi.String("arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1"),
    			Tags: aws.TagArray{
    				&aws.TagArgs{
    					Key:   pulumi.String("keyname1"),
    					Value: pulumi.String("value1"),
    				},
    				&aws.TagArgs{
    					Key:   pulumi.String("keyname2"),
    					Value: pulumi.String("value2"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    my_state_machine = aws_native.stepfunctions.StateMachine("myStateMachine",
        state_machine_name="HelloWorld-StateMachine",
        definition_string="""{
      "StartAt": "HelloWorld",
      "States": {
        "HelloWorld": {
          "Type": "Task",
          "Resource": "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
          "End": true
        }
      }
    }""",
        role_arn="arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1",
        tags=[
            aws_native.TagArgs(
                key="keyname1",
                value="value1",
            ),
            aws_native.TagArgs(
                key="keyname2",
                value="value2",
            ),
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const myStateMachine = new aws_native.stepfunctions.StateMachine("myStateMachine", {
        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",
            },
        ],
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var myStateMachine = new AwsNative.StepFunctions.StateMachine("myStateMachine", new()
        {
            StateMachineName = "HelloWorld-StateMachine",
            DefinitionS3Location = new AwsNative.StepFunctions.Inputs.StateMachineS3LocationArgs
            {
                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",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/stepfunctions"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := stepfunctions.NewStateMachine(ctx, "myStateMachine", &stepfunctions.StateMachineArgs{
    			StateMachineName: pulumi.String("HelloWorld-StateMachine"),
    			DefinitionS3Location: &stepfunctions.StateMachineS3LocationArgs{
    				Bucket: pulumi.String("example_bucket"),
    				Key:    pulumi.String("hello_world.json"),
    			},
    			DefinitionSubstitutions: pulumi.Map{
    				"helloFunction": pulumi.Any("arn:aws:lambda:us-east-1:111122223333:function:HelloFunction"),
    			},
    			RoleArn: pulumi.String("arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    my_state_machine = aws_native.stepfunctions.StateMachine("myStateMachine",
        state_machine_name="HelloWorld-StateMachine",
        definition_s3_location=aws_native.stepfunctions.StateMachineS3LocationArgs(
            bucket="example_bucket",
            key="hello_world.json",
        ),
        definition_substitutions={
            "helloFunction": "arn:aws:lambda:us-east-1:111122223333:function:HelloFunction",
        },
        role_arn="arn:aws:iam::111122223333:role/service-role/StatesExecutionRole-us-east-1")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const myStateMachine = new aws_native.stepfunctions.StateMachine("myStateMachine", {
        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",
    });
    

    Coming soon!

    Create StateMachine Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new StateMachine(name: string, args: StateMachineArgs, opts?: CustomResourceOptions);
    @overload
    def StateMachine(resource_name: str,
                     args: StateMachineArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def StateMachine(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     role_arn: Optional[str] = None,
                     definition: Optional[StateMachineDefinitionArgs] = None,
                     definition_s3_location: Optional[StateMachineS3LocationArgs] = None,
                     definition_string: Optional[str] = None,
                     definition_substitutions: Optional[Mapping[str, Union[str, int, bool]]] = None,
                     logging_configuration: Optional[StateMachineLoggingConfigurationArgs] = None,
                     state_machine_name: Optional[str] = None,
                     state_machine_type: Optional[StateMachineType] = None,
                     tags: Optional[Sequence[_root_inputs.TagArgs]] = None,
                     tracing_configuration: Optional[StateMachineTracingConfigurationArgs] = 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-native:stepfunctions:StateMachine
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.

    Example

    The following reference example uses placeholder values for all input properties.

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    const stateMachineResource = new aws_native.stepfunctions.StateMachine("stateMachineResource", {
        roleArn: "string",
        definition: {},
        definitionS3Location: {
            bucket: "string",
            key: "string",
            version: "string",
        },
        definitionString: "string",
        definitionSubstitutions: {
            string: "string",
        },
        loggingConfiguration: {
            destinations: [{
                cloudWatchLogsLogGroup: {
                    logGroupArn: "string",
                },
            }],
            includeExecutionData: false,
            level: aws_native.stepfunctions.StateMachineLoggingConfigurationLevel.All,
        },
        stateMachineName: "string",
        stateMachineType: aws_native.stepfunctions.StateMachineType.Standard,
        tags: [{
            key: "string",
            value: "string",
        }],
        tracingConfiguration: {
            enabled: false,
        },
    });
    
    Coming soon!
    

    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:

    Outputs

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

    Arn string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    StateMachineRevisionId string
    Arn string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    StateMachineRevisionId string
    arn String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    stateMachineRevisionId String
    arn string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    stateMachineRevisionId string
    arn str
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    state_machine_revision_id str
    arn String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    stateMachineRevisionId String

    Supporting Types

    StateMachineCloudWatchLogsLogGroup, StateMachineCloudWatchLogsLogGroupArgs

    StateMachineLogDestination, StateMachineLogDestinationArgs

    StateMachineLoggingConfiguration, StateMachineLoggingConfigurationArgs

    StateMachineLoggingConfigurationLevel, StateMachineLoggingConfigurationLevelArgs

    All
    ALL
    Error
    ERROR
    Fatal
    FATAL
    Off
    OFF
    StateMachineLoggingConfigurationLevelAll
    ALL
    StateMachineLoggingConfigurationLevelError
    ERROR
    StateMachineLoggingConfigurationLevelFatal
    FATAL
    StateMachineLoggingConfigurationLevelOff
    OFF
    All
    ALL
    Error
    ERROR
    Fatal
    FATAL
    Off
    OFF
    All
    ALL
    Error
    ERROR
    Fatal
    FATAL
    Off
    OFF
    ALL
    ALL
    ERROR
    ERROR
    FATAL
    FATAL
    OFF
    OFF
    "ALL"
    ALL
    "ERROR"
    ERROR
    "FATAL"
    FATAL
    "OFF"
    OFF

    StateMachineS3Location, StateMachineS3LocationArgs

    Bucket string
    Key string
    Version string
    Bucket string
    Key string
    Version string
    bucket String
    key String
    version String
    bucket string
    key string
    version string
    bucket str
    key str
    version str
    bucket String
    key String
    version String

    StateMachineTracingConfiguration, StateMachineTracingConfigurationArgs

    Enabled bool
    Enabled bool
    enabled Boolean
    enabled boolean
    enabled bool
    enabled Boolean

    StateMachineType, StateMachineTypeArgs

    Standard
    STANDARD
    Express
    EXPRESS
    StateMachineTypeStandard
    STANDARD
    StateMachineTypeExpress
    EXPRESS
    Standard
    STANDARD
    Express
    EXPRESS
    Standard
    STANDARD
    Express
    EXPRESS
    STANDARD
    STANDARD
    EXPRESS
    EXPRESS
    "STANDARD"
    STANDARD
    "EXPRESS"
    EXPRESS

    Tag, TagArgs

    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    AWS Native is in preview. AWS Classic is fully supported.

    AWS Native v0.101.0 published on Thursday, Apr 11, 2024 by Pulumi