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
new StateMachine(name: string, args: StateMachineArgs, opts?: CustomResourceOptions);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)public StateMachine(string name, StateMachineArgs args, CustomResourceOptions? opts = null)- 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:
Outputs
All input properties are implicitly available as output properties. Additionally, the StateMachine resource produces the following output properties:
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): StateMachinestatic 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.
- Creation
Date 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.
- Role
Arn 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”.
- Dictionary<string, string>
Key-value map of resource tags
- Arn string
The ARN of the state machine.
- Creation
Date 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.
- Role
Arn 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”.
- map[string]string
Key-value map of resource tags
- arn string
The ARN of the state machine.
- creation
Date 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.
- role
Arn 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”.
- {[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”.
- 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
awsTerraform Provider.