StateProps

class aws_cdk.aws_iotevents.StateProps(*, state_name, on_enter=None, on_exit=None, on_input=None)

Bases: object

(experimental) Properties for defining a state of a detector.

Parameters:
  • state_name (str) – (experimental) The name of the state.

  • on_enter (Optional[Sequence[Union[Event, Dict[str, Any]]]]) – (experimental) Specifies the events on enter. The conditions of the events will be evaluated when entering this state. If the condition of the event evaluates to true, the actions of the event will be executed. Default: - no events will trigger on entering this state

  • on_exit (Optional[Sequence[Union[Event, Dict[str, Any]]]]) – (experimental) Specifies the events on exit. The conditions of the events are evaluated when an exiting this state. If the condition evaluates to true, the actions of the event will be executed. Default: - no events will trigger on exiting this state

  • on_input (Optional[Sequence[Union[Event, Dict[str, Any]]]]) – (experimental) Specifies the events on input. The conditions of the events will be evaluated when any input is received. If the condition of the event evaluates to true, the actions of the event will be executed. Default: - no events will trigger on input in this state

Stability:

experimental

ExampleMetadata:

infused

Example:

# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_iotevents as iotevents
import aws_cdk.aws_iotevents_actions as actions

# input: iotevents.IInput

state = iotevents.State(
    state_name="MyState",
    on_enter=[iotevents.Event(
        event_name="test-event",
        condition=iotevents.Expression.current_input(input),
        actions=[actions, [
            actions.SetVariableAction("MyVariable",
                iotevents.Expression.input_attribute(input, "payload.temperature"))
        ]
        ]
    )]
)

Attributes

on_enter

(experimental) Specifies the events on enter.

The conditions of the events will be evaluated when entering this state. If the condition of the event evaluates to true, the actions of the event will be executed.

Default:
  • no events will trigger on entering this state

Stability:

experimental

on_exit

(experimental) Specifies the events on exit.

The conditions of the events are evaluated when an exiting this state. If the condition evaluates to true, the actions of the event will be executed.

Default:
  • no events will trigger on exiting this state

Stability:

experimental

on_input

(experimental) Specifies the events on input.

The conditions of the events will be evaluated when any input is received. If the condition of the event evaluates to true, the actions of the event will be executed.

Default:
  • no events will trigger on input in this state

Stability:

experimental

state_name

(experimental) The name of the state.

Stability:

experimental