Skip to content

Validate State Machine Definition

sfn_validate_state_machine_definition R Documentation

Validates the syntax of a state machine definition

Description

Validates the syntax of a state machine definition.

You can validate that a state machine definition is correct without creating a state machine resource. Step Functions will implicitly perform the same syntax check when you invoke create_state_machine and update_state_machine. State machine definitions are specified using a JSON-based, structured language. For more information on Amazon States Language see Amazon States Language (ASL).

Suggested uses for validate_state_machine_definition:

  • Integrate automated checks into your code review or Continuous Integration (CI) process to validate state machine definitions before starting deployments.

  • Run the validation from a Git pre-commit hook to check your state machine definitions before committing them to your source repository.

Errors found in the state machine definition will be returned in the response as a list of diagnostic elements, rather than raise an exception.

Usage

sfn_validate_state_machine_definition(definition, type, severity,
  maxResults)

Arguments

definition

[required] The Amazon States Language definition of the state machine. For more information, see Amazon States Language (ASL).

type

The target type of state machine for this definition. The default is STANDARD.

severity

Minimum level of diagnostics to return. ERROR returns only ERROR diagnostics, whereas WARNING returns both WARNING and ERROR diagnostics. The default is ERROR.

maxResults

The maximum number of diagnostics that are returned per call. The default and maximum value is 100. Setting the value to 0 will also use the default of 100.

If the number of diagnostics returned in the response exceeds maxResults, the value of the truncated field in the response will be set to true.

Value

A list with the following syntax:

list(
  result = "OK"|"FAIL",
  diagnostics = list(
    list(
      severity = "ERROR"|"WARNING",
      code = "string",
      message = "string",
      location = "string"
    )
  ),
  truncated = TRUE|FALSE
)

Request syntax

svc$validate_state_machine_definition(
  definition = "string",
  type = "STANDARD"|"EXPRESS",
  severity = "ERROR"|"WARNING",
  maxResults = 123
)