github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/aws/r/sfn_state_machine.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: sfn_state_machine" 4 sidebar_current: "docs-aws-resource-sfn-state-machine" 5 description: |- 6 Provides a Step Function State Machine resource. 7 --- 8 9 # sfn\_state\_machine 10 11 Provides a Step Function State Machine resource 12 13 ## Example Usage 14 15 ```hcl 16 # ... 17 18 resource "aws_sfn_state_machine" "sfn_state_machine" { 19 name = "my-state-machine" 20 role_arn = "${aws_iam_role.iam_for_sfn.arn}" 21 22 definition = <<EOF 23 { 24 "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function", 25 "StartAt": "HelloWorld", 26 "States": { 27 "HelloWorld": { 28 "Type": "Task", 29 "Resource": "${aws_lambda_function.lambda.arn}", 30 "End": true 31 } 32 } 33 } 34 EOF 35 } 36 ``` 37 38 ## Argument Reference 39 40 The following arguments are supported: 41 42 * `name` - (Required) The name of the state machine. 43 * `definition` - (Required) The Amazon States Language definition of the state machine. 44 * `role_arn` - (Required) The Amazon Resource Name (ARN) of the IAM role to use for this state machine. 45 46 ## Attributes Reference 47 48 The following attributes are exported: 49 50 * `id` - The ARN of the state machine. 51 * `creation_date` - The date the state machine was created. 52 * `status` - The current status of the state machine. Either "ACTIVE" or "DELETING". 53 54 ## Import 55 56 State Machines can be imported using the `arn`, e.g. 57 58 ``` 59 $ terraform import aws_sfn_state_machine.foo arn:aws:states:eu-west-1:123456789098:stateMachine:bar 60 ```