@aws-cdk_aws-iotevents-alpha.State

class State ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.IoTEvents.Alpha.State
Gogithub.com/aws/aws-cdk-go/awscdkioteventsalpha/v2#State
Javasoftware.amazon.awscdk.services.iotevents.alpha.State
Pythonaws_cdk.aws_iotevents_alpha.State
TypeScript (source)@aws-cdk/aws-iotevents-alpha ยป State

Defines a state of a detector.

Example

import * as iotevents from '@aws-cdk/aws-iotevents-alpha';
import * as actions from '@aws-cdk/aws-iotevents-actions-alpha';

declare const input: iotevents.IInput;

const state = new iotevents.State({
  stateName: 'MyState',
  onEnter: [{
    eventName: 'test-event',
    condition: iotevents.Expression.currentInput(input),
    actions: [
      new actions.SetTimerAction('MyTimer', {
        duration: cdk.Duration.seconds(60),
      }),
    ],
  }],
});

Initializer

new State(props: StateProps)

Parameters

  • props StateProps

Properties

NameTypeDescription
stateName๐Ÿ”นstringThe name of the state.

stateName๐Ÿ”น

Type: string

The name of the state.

Methods

NameDescription
transitionTo(targetState, options)๐Ÿ”นAdd a transition event to the state.

transitionTo(targetState, options)๐Ÿ”น

public transitionTo(targetState: State, options: TransitionOptions): void

Parameters

  • targetState State โ€” the state that will be transit to when the event triggered.
  • options TransitionOptions โ€” transition options including the condition that causes the state transition.

Add a transition event to the state.

The transition event will be triggered if condition is evaluated to true.