Class CfnStateMachine

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.863Z") @Stability(Stable) public class CfnStateMachine extends CfnResource implements IInspectable
A CloudFormation AWS::StepFunctions::StateMachine.

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.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.stepfunctions.*;
 Object definition;
 Object definitionSubstitutions;
 CfnStateMachine cfnStateMachine = CfnStateMachine.Builder.create(this, "MyCfnStateMachine")
         .roleArn("roleArn")
         // the properties below are optional
         .definition(definition)
         .definitionS3Location(S3LocationProperty.builder()
                 .bucket("bucket")
                 .key("key")
                 // the properties below are optional
                 .version("version")
                 .build())
         .definitionString("definitionString")
         .definitionSubstitutions(Map.of(
                 "definitionSubstitutionsKey", definitionSubstitutions))
         .loggingConfiguration(LoggingConfigurationProperty.builder()
                 .destinations(List.of(LogDestinationProperty.builder()
                         .cloudWatchLogsLogGroup(CloudWatchLogsLogGroupProperty.builder()
                                 .logGroupArn("logGroupArn")
                                 .build())
                         .build()))
                 .includeExecutionData(false)
                 .level("level")
                 .build())
         .stateMachineName("stateMachineName")
         .stateMachineType("stateMachineType")
         .tags(List.of(TagsEntryProperty.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .tracingConfiguration(TracingConfigurationProperty.builder()
                 .enabled(false)
                 .build())
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnStateMachine

      protected CfnStateMachine(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnStateMachine

      protected CfnStateMachine(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnStateMachine

      @Stability(Stable) public CfnStateMachine(@NotNull Construct scope, @NotNull String id, @NotNull CfnStateMachineProps props)
      Create a new AWS::StepFunctions::StateMachine.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
    • getAttrName

      @Stability(Stable) @NotNull public String getAttrName()
      Returns the name of the state machine. For example:.

      { "Fn::GetAtt": ["MyStateMachine", "Name"] }

      Returns the name of your state machine:

      HelloWorld-StateMachine

      If you did not specify the name it will be similar to the following:

      MyStateMachine-1234abcdefgh

      For more information about using Fn::GetAtt , see Fn::GetAtt .

    • getAttrStateMachineRevisionId

      @Stability(Stable) @NotNull public String getAttrStateMachineRevisionId()
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      The list of tags to add to a resource.

      Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @ .

    • getDefinition

      @Stability(Stable) @NotNull public Object getDefinition()
      The Amazon States Language definition of the state machine.

      The state machine definition must be in JSON or YAML, and the format of the object must match the format of your AWS Step Functions template file. See Amazon States Language .

    • setDefinition

      @Stability(Stable) public void setDefinition(@NotNull Object value)
      The Amazon States Language definition of the state machine.

      The state machine definition must be in JSON or YAML, and the format of the object must match the format of your AWS Step Functions template file. See Amazon States Language .

    • getRoleArn

      @Stability(Stable) @NotNull public String getRoleArn()
      The Amazon Resource Name (ARN) of the IAM role to use for this state machine.
    • setRoleArn

      @Stability(Stable) public void setRoleArn(@NotNull String value)
      The Amazon Resource Name (ARN) of the IAM role to use for this state machine.
    • getDefinitionS3Location

      @Stability(Stable) @Nullable public Object getDefinitionS3Location()
      The name of the S3 bucket where the state machine definition is stored.

      The state machine definition must be a JSON or YAML file.

    • setDefinitionS3Location

      @Stability(Stable) public void setDefinitionS3Location(@Nullable IResolvable value)
      The name of the S3 bucket where the state machine definition is stored.

      The state machine definition must be a JSON or YAML file.

    • setDefinitionS3Location

      @Stability(Stable) public void setDefinitionS3Location(@Nullable CfnStateMachine.S3LocationProperty value)
      The name of the S3 bucket where the state machine definition is stored.

      The state machine definition must be a JSON or YAML file.

    • getDefinitionString

      @Stability(Stable) @Nullable public String getDefinitionString()
      The Amazon States Language definition of the state machine.

      The state machine definition must be in JSON. See Amazon States Language .

    • setDefinitionString

      @Stability(Stable) public void setDefinitionString(@Nullable String value)
      The Amazon States Language definition of the state machine.

      The state machine definition must be in JSON. See Amazon States Language .

    • getDefinitionSubstitutions

      @Stability(Stable) @Nullable public Object getDefinitionSubstitutions()
      A map (string to string) that specifies the mappings for placeholder variables in the state machine definition.

      This enables the customer to inject values obtained at runtime, for example from intrinsic functions, in the state machine definition. Variables can be template parameter names, resource logical IDs, resource attributes, or a variable in a key-value map.

    • setDefinitionSubstitutions

      @Stability(Stable) public void setDefinitionSubstitutions(@Nullable IResolvable value)
      A map (string to string) that specifies the mappings for placeholder variables in the state machine definition.

      This enables the customer to inject values obtained at runtime, for example from intrinsic functions, in the state machine definition. Variables can be template parameter names, resource logical IDs, resource attributes, or a variable in a key-value map.

    • setDefinitionSubstitutions

      @Stability(Stable) public void setDefinitionSubstitutions(@Nullable Map<String,Object> value)
      A map (string to string) that specifies the mappings for placeholder variables in the state machine definition.

      This enables the customer to inject values obtained at runtime, for example from intrinsic functions, in the state machine definition. Variables can be template parameter names, resource logical IDs, resource attributes, or a variable in a key-value map.

    • getLoggingConfiguration

      @Stability(Stable) @Nullable public Object getLoggingConfiguration()
      Defines what execution history events are logged and where they are logged.

      By default, the level is set to OFF . For more information see Log Levels in the AWS Step Functions User Guide.

    • setLoggingConfiguration

      @Stability(Stable) public void setLoggingConfiguration(@Nullable IResolvable value)
      Defines what execution history events are logged and where they are logged.

      By default, the level is set to OFF . For more information see Log Levels in the AWS Step Functions User Guide.

    • setLoggingConfiguration

      @Stability(Stable) public void setLoggingConfiguration(@Nullable CfnStateMachine.LoggingConfigurationProperty value)
      Defines what execution history events are logged and where they are logged.

      By default, the level is set to OFF . For more information see Log Levels in the AWS Step Functions User Guide.

    • getStateMachineName

      @Stability(Stable) @Nullable public String getStateMachineName()
      The name of the state machine.

      A name must not contain:

      • white space
      • brackets < > { } [ ]
      • wildcard characters ? *
      • special characters " # % \ ^ | ~ $ & , ; : /`
      • control characters ( U+0000-001F , U+007F-009F )

      If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

    • setStateMachineName

      @Stability(Stable) public void setStateMachineName(@Nullable String value)
      The name of the state machine.

      A name must not contain:

      • white space
      • brackets < > { } [ ]
      • wildcard characters ? *
      • special characters " # % \ ^ | ~ $ & , ; : /`
      • control characters ( U+0000-001F , U+007F-009F )

      If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

    • getStateMachineType

      @Stability(Stable) @Nullable public String getStateMachineType()
      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. For more information on STANDARD and EXPRESS workflows, see Standard Versus Express Workflows in the AWS Step Functions Developer Guide.

    • setStateMachineType

      @Stability(Stable) public void setStateMachineType(@Nullable String value)
      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. For more information on STANDARD and EXPRESS workflows, see Standard Versus Express Workflows in the AWS Step Functions Developer Guide.

    • getTracingConfiguration

      @Stability(Stable) @Nullable public Object getTracingConfiguration()
      Selects whether or not the state machine's AWS X-Ray tracing is enabled.
    • setTracingConfiguration

      @Stability(Stable) public void setTracingConfiguration(@Nullable IResolvable value)
      Selects whether or not the state machine's AWS X-Ray tracing is enabled.
    • setTracingConfiguration

      @Stability(Stable) public void setTracingConfiguration(@Nullable CfnStateMachine.TracingConfigurationProperty value)
      Selects whether or not the state machine's AWS X-Ray tracing is enabled.