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
-
arnoptional computed - string -
creation_dateoptional computed - string -
definitionrequired - string -
idoptional computed - string -
namerequired - string -
role_arnrequired - string -
statusoptional computed - string -
tagsoptional - map from string to string -
typeoptional - string -
logging_configurationlist block-
include_execution_dataoptional - bool -
leveloptional - string -
log_destinationoptional - 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
-
DefinitionStringoptional - String -
RoleArnrequired - String -
StateMachineNameoptional - String -
StateMachineTypeoptional - String -
LoggingConfigurationoptional - LoggingConfiguration -
TracingConfigurationoptional - TracingConfiguration -
DefinitionS3Locationoptional - S3Location -
DefinitionSubstitutionsoptional - Map -
Definitionoptional - Definition -
Tagsoptional - List of TagsEntry
Explanation in CloudFormation Registry
Provisions a state machine. A state machine consists of a collection of states that can do work (
Taskstates), determine to which states to transition next (Choicestates), stop an execution with an error (Failstates), 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.