Experimental
@aws-cdk/aws-iot-actions-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
StepFunctionsStateMachineAction Class
The action to put the record from an MQTT message to the Step Functions State Machine.
Example
ts
const stateMachine = new stepfunctions.StateMachine(this, 'SM', {
definitionBody: stepfunctions.DefinitionBody.fromChainable(new stepfunctions.Wait(this, 'Hello', { time: stepfunctions.WaitTime.duration(Duration.seconds(10)) })),
});
new iot.TopicRule(this, 'TopicRule', {
sql: iot.IotSql.fromStringAsVer20160323("SELECT * FROM 'device/+/data'"),
actions: [
new actions.StepFunctionsStateMachineAction(stateMachine),
],
});
python
state_machine = stepfunctions.StateMachine(self, "SM",
definition_body=stepfunctions.DefinitionBody.from_chainable(stepfunctions.Wait(self, "Hello", time=stepfunctions.WaitTime.duration(Duration.seconds(10))))
)
iot.TopicRule(self, "TopicRule",
sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
actions=[
actions.StepFunctionsStateMachineAction(state_machine)
]
)
java
StateMachine stateMachine = StateMachine.Builder.create(this, "SM")
.definitionBody(DefinitionBody.fromChainable(Wait.Builder.create(this, "Hello").time(WaitTime.duration(Duration.seconds(10))).build()))
.build();
TopicRule.Builder.create(this, "TopicRule")
.sql(IotSql.fromStringAsVer20160323("SELECT * FROM 'device/+/data'"))
.actions(List.of(
new StepFunctionsStateMachineAction(stateMachine)))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.IoT.Actions.Alpha
var stateMachine = new StateMachine(this, "SM", new StateMachineProps {
DefinitionBody = DefinitionBody.FromChainable(new Wait(this, "Hello", new WaitProps { Time = WaitTime.Duration(Duration.Seconds(10)) }))
});
new TopicRule(this, "TopicRule", new TopicRuleProps {
Sql = IotSql.FromStringAsVer20160323("SELECT * FROM 'device/+/data'"),
Actions = new [] {
new StepFunctionsStateMachineAction(stateMachine) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkiotactionsalpha/v2
stateMachine := stepfunctions.NewStateMachine(this, jsii.String("SM"), &StateMachineProps{
DefinitionBody: stepfunctions.DefinitionBody_FromChainable(stepfunctions.NewWait(this, jsii.String("Hello"), &WaitProps{
Time: stepfunctions.WaitTime_Duration(awscdk.Duration_Seconds(jsii.Number(10))),
})),
})
iot.NewTopicRule(this, jsii.String("TopicRule"), &TopicRuleProps{
Sql: iot.IotSql_FromStringAsVer20160323(jsii.String("SELECT * FROM 'device/+/data'")),
Actions: []IAction{
actions.NewStepFunctionsStateMachineAction(stateMachine),
},
})
Initializer
ts
new StepFunctionsStateMachineAction(stateMachine: IStateMachine, props?: StepFunctionsStateMachineActionProps)
python
StepFunctionsStateMachineAction(state_machine: IStateMachine, props: typing.Optional[StepFunctionsStateMachineActionProps] = None)
java
new StepFunctionsStateMachineAction(IStateMachine stateMachine, StepFunctionsStateMachineActionProps props)
csharp
new StepFunctionsStateMachineAction(IStateMachine stateMachine, StepFunctionsStateMachineActionProps? props = null)
go
NewStepFunctionsStateMachineAction(StateMachine IStateMachine, Props StepFunctionsStateMachineActionProps)