ChoiceProps

class aws_cdk.aws_stepfunctions.ChoiceProps(*, comment=None, input_path=None, output_path=None, state_name=None)

Bases: object

Properties for defining a Choice state.

Parameters:
  • comment (Optional[str]) – An optional description for this state. Default: No comment

  • input_path (Optional[str]) – JSONPath expression to select part of the state to be the input to this state. May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}. Default: $

  • output_path (Optional[str]) – JSONPath expression to select part of the state to be the output to this state. May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}. Default: $

  • state_name (Optional[str]) – Optional name for this state. Default: - The construct ID will be used as state name

ExampleMetadata:

infused

Example:

choice = sfn.Choice(self, "What color is it?",
    comment="color comment"
)
handle_blue_item = sfn.Pass(self, "HandleBlueItem")
handle_other_item_color = sfn.Pass(self, "HanldeOtherItemColor")
choice.when(sfn.Condition.string_equals("$.color", "BLUE"), handle_blue_item,
    comment="blue item comment"
)
choice.otherwise(handle_other_item_color)

Attributes

comment

An optional description for this state.

Default:

No comment

input_path

JSONPath expression to select part of the state to be the input to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.

Default:

$

output_path

JSONPath expression to select part of the state to be the output to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.

Default:

$

state_name

Optional name for this state.

Default:
  • The construct ID will be used as state name