Skip to content

TestStateInput

Source code in docs_src/capo_sfn/types/test_state_input.py
class TestStateInput(TypedDict, closed=True):
    definition: "capo_sfn.types.definition.Definition"
    """<p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>"""
    role_arn: NotRequired["capo_sfn.types.arn.Arn"]
    """<p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>"""
    input: NotRequired["capo_sfn.types.sensitive_data.SensitiveData"]
    """<p>A string that contains the JSON input data for the state.</p>"""
    inspection_level: NotRequired["capo_sfn.types.inspection_level.InspectionLevel"]
    """<p>Determines the values to return when a state is tested. You can specify one of the following types:</p> <ul> <li> <p> <code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p> </li> <li> <p> <code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p> </li> <li> <p> <code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p> </li> </ul> <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>"""
    reveal_secrets: "capo_sfn.types.reveal_secrets.RevealSecrets"
    """<p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p> <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p> <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>"""
    variables: NotRequired["capo_sfn.types.sensitive_data.SensitiveData"]
    """<p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>"""
    state_name: NotRequired["capo_sfn.types.test_state_state_name.TestStateStateName"]
    """<p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>"""
    mock: NotRequired["capo_sfn.types.mock_input.MockInput"]
    """<p>Defines a mocked result or error for the state under test.</p> <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>"""
    context: NotRequired["capo_sfn.types.sensitive_data.SensitiveData"]
    """<p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>"""
    state_configuration: NotRequired[
        "capo_sfn.types.test_state_configuration.TestStateConfiguration"
    ]
    """<p>Contains configurations for the state under test.</p>"""

context instance-attribute

context: NotRequired[SensitiveData]

A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.

definition instance-attribute

definition: Definition

The Amazon States Language (ASL) definition of the state or state machine.

input instance-attribute

input: NotRequired[SensitiveData]

A string that contains the JSON input data for the state.

inspection_level instance-attribute

inspection_level: NotRequired[InspectionLevel]

Determines the values to return when a state is tested. You can specify one of the following types:

  • INFO: Shows the final state output. By default, Step Functions sets inspectionLevel to INFO if you don't specify a level.

  • DEBUG: Shows the final state output along with the input and output data processing result.

  • TRACE: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.

Each of these levels also provide information about the status of the state execution and the next state to transition to.

mock instance-attribute

mock: NotRequired[MockInput]

Defines a mocked result or error for the state under test.

A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.

reveal_secrets instance-attribute

reveal_secrets: RevealSecrets

Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.

If you set revealSecrets to true, you must make sure that the IAM user that calls the TestState API has permission for the states:RevealSecrets action. For an example of IAM policy that sets the states:RevealSecrets permission, see IAM permissions to test a state. Without this permission, Step Functions throws an access denied error.

By default, revealSecrets is set to false.

role_arn instance-attribute

role_arn: NotRequired[Arn]

The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.

state_configuration instance-attribute

state_configuration: NotRequired[TestStateConfiguration]

Contains configurations for the state under test.

state_name instance-attribute

state_name: NotRequired[TestStateStateName]

Denotes the particular state within a state machine definition to be tested. If this field is specified, the definition must contain a fully-formed state machine definition.

variables instance-attribute

variables: NotRequired[SensitiveData]

JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.