StateMachine

Provides a Step Function State Machine resource

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var sfnStateMachine = new Aws.Sfn.StateMachine("sfnStateMachine", new Aws.Sfn.StateMachineArgs
        {
            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
    }}
  }}
}}

",
            RoleArn = aws_iam_role.Iam_for_sfn.Arn,
        });
    }

}
package main

import (
    "fmt"

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

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

sfn_state_machine = aws.sfn.StateMachine("sfnStateMachine",
    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
    }}
  }}
}}

""",
    role_arn=aws_iam_role["iam_for_sfn"]["arn"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const sfnStateMachine = new aws.sfn.StateMachine("sfn_state_machine", {
    definition: pulumi.interpolate`{
  "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
    }
  }
}
`,
    roleArn: aws_iam_role_iam_for_sfn.arn,
});

Create a StateMachine Resource

def StateMachine(resource_name, opts=None, definition=None, name=None, role_arn=None, tags=None, __props__=None);
func NewStateMachine(ctx *Context, name string, args StateMachineArgs, opts ...ResourceOption) (*StateMachine, error)
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.
opts ResourceOptions
A bag of options that control this 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.

StateMachine Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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.

Name string

The name of the state machine.

Tags Dictionary<string, string>

Key-value map of resource tags

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.

Name string

The name of the state machine.

Tags map[string]string

Key-value map of resource tags

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.

name string

The name of the state machine.

tags {[key: string]: string}

Key-value map of resource tags

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.

name str

The name of the state machine.

tags Dict[str, str]

Key-value map of resource tags

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

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

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

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

Look up an 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
static get(resource_name, id, opts=None, arn=None, creation_date=None, definition=None, name=None, role_arn=None, status=None, tags=None, __props__=None);
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)
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.

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.

Name string

The name of the state machine.

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

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.

Name string

The name of the state machine.

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

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.

name string

The name of the state machine.

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

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.

name str

The name of the state machine.

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 Dict[str, str]

Key-value map of resource tags

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.