AWS Step Functions State Machine
This page shows how to write Terraform and CloudFormation for Step Functions State Machine and write them securely.
aws_sfn_state_machine (Terraform)
The State Machine in Step Functions can be configured in Terraform with the resource name aws_sfn_state_machine
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_sfn_state_machine" "expressWithoutUsage" {
name = "my-state-machine"
role_arn = "arn:aws:lambda:us-east-1:123456789012:resource-id"
type = "EXPRESS"
definition = <<EOF
{
resource "aws_sfn_state_machine" "claire_investigation" {
name = "claire_investigation"
role_arn = aws_iam_role.claire_state_machine_role.arn
definition = data.template_file.claire_investigation_state_machine.rendered
}
Parameters
-
arn
optional computed - string -
creation_date
optional computed - string -
definition
required - string -
id
optional computed - string -
name
required - string -
role_arn
required - string -
status
optional computed - string -
tags
optional - map from string to string -
type
optional - string -
logging_configuration
list block-
include_execution_data
optional - bool -
level
optional - string -
log_destination
optional - string
-
Explanation in Terraform Registry
Provides a Step Function State Machine resource
AWS::StepFunctions::StateMachine (CloudFormation)
The StateMachine in StepFunctions can be configured in CloudFormation with the resource name AWS::StepFunctions::StateMachine
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
DefinitionString
optional - String -
RoleArn
required - String -
StateMachineName
optional - String -
StateMachineType
optional - String -
LoggingConfiguration
optional - LoggingConfiguration -
TracingConfiguration
optional - TracingConfiguration -
DefinitionS3Location
optional - S3Location -
DefinitionSubstitutions
optional - Map -
Definition
optional - Definition -
Tags
optional - List of TagsEntry
Explanation in CloudFormation Registry
Provisions a state machine. A state machine consists of a collection of states that can do work (
Task
states), determine to which states to transition next (Choice
states), stop an execution with an error (Fail
states), and so on. State machines are specified using a JSON-based, structured language.
Frequently asked questions
What is AWS Step Functions State Machine?
AWS Step Functions State Machine is a resource for Step Functions of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Step Functions State Machine?
For Terraform, the gilyas/infracost and roguehedgehog/claire source code examples are useful. See the Terraform Example section for further details.