StateMachineArgs

data class StateMachineArgs(val definition: Output<String>? = null, val loggingConfiguration: Output<StateMachineLoggingConfigurationArgs>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val roleArn: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val tracingConfiguration: Output<StateMachineTracingConfigurationArgs>? = null, val type: Output<String>? = null) : ConvertibleToJava<StateMachineArgs>

Provides a Step Function State Machine resource

Example Usage

Basic (Standard Workflow)

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sfn.StateMachine;
import com.pulumi.aws.sfn.StateMachineArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var sfnStateMachine = new StateMachine("sfnStateMachine", StateMachineArgs.builder()
.roleArn(aws_iam_role.iam_for_sfn().arn())
.definition("""
{
"Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Task",
"Resource": "%s",
"End": true
}
}
}
", aws_lambda_function.lambda().arn()))
.build());
}
}

Basic (Express Workflow)

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sfn.StateMachine;
import com.pulumi.aws.sfn.StateMachineArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var sfnStateMachine = new StateMachine("sfnStateMachine", StateMachineArgs.builder()
.roleArn(aws_iam_role.iam_for_sfn().arn())
.type("EXPRESS")
.definition("""
{
"Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Task",
"Resource": "%s",
"End": true
}
}
}
", aws_lambda_function.lambda().arn()))
.build());
}
}

Logging

NOTE: See the AWS Step Functions Developer Guide for more information about enabling Step Function logging.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sfn.StateMachine;
import com.pulumi.aws.sfn.StateMachineArgs;
import com.pulumi.aws.sfn.inputs.StateMachineLoggingConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var sfnStateMachine = new StateMachine("sfnStateMachine", StateMachineArgs.builder()
.roleArn(aws_iam_role.iam_for_sfn().arn())
.definition("""
{
"Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Task",
"Resource": "%s",
"End": true
}
}
}
", aws_lambda_function.lambda().arn()))
.loggingConfiguration(StateMachineLoggingConfigurationArgs.builder()
.logDestination(String.format("%s:*", aws_cloudwatch_log_group.log_group_for_sfn().arn()))
.includeExecutionData(true)
.level("ERROR")
.build())
.build());
}
}

Import

State Machines can be imported using the arn, e.g.,

$ pulumi import aws:sfn/stateMachine:StateMachine foo arn:aws:states:eu-west-1:123456789098:stateMachine:bar

Constructors

Link copied to clipboard
constructor(definition: Output<String>? = null, loggingConfiguration: Output<StateMachineLoggingConfigurationArgs>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, roleArn: Output<String>? = null, tags: Output<Map<String, String>>? = null, tracingConfiguration: Output<StateMachineTracingConfigurationArgs>? = null, type: Output<String>? = null)

Properties

Link copied to clipboard
val definition: Output<String>? = null

The Amazon States Language definition of the state machine.

Link copied to clipboard

Defines what execution history events are logged and where they are logged. The logging_configuration parameter is only valid when type is set to EXPRESS. Defaults to OFF. For more information see Logging Express Workflows and Log Levels in the AWS Step Functions User Guide.

Link copied to clipboard
val name: Output<String>? = null

The name of the state machine. The name should only contain 0-9, A-Z, a-z, - and _. If omitted, the provider will assign a random, unique name.

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with name.

Link copied to clipboard
val roleArn: Output<String>? = null

The Amazon Resource Name (ARN) of the IAM role to use for this state machine.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard

Selects whether AWS X-Ray tracing is enabled.

Link copied to clipboard
val type: Output<String>? = null

Determines whether a Standard or Express state machine is created. The default is STANDARD. You cannot update the type of a state machine once it has been created. Valid values: STANDARD, EXPRESS.

Functions

Link copied to clipboard
open override fun toJava(): StateMachineArgs