See: Description
| Class | Description |
|---|---|
| LambdaInvokeAction |
(experimental) The action to write the data to an AWS Lambda function.
|
| SetVariableAction |
(experimental) The action to create a variable with a specified value.
|
This library contains integration classes to specify actions of state events of Detector Model in @aws-cdk/aws-iotevents.
Instances of these classes should be passed to State defined in @aws-cdk/aws-iotevents
You can define built-in actions to use a timer or set a variable, or send data to other AWS resources.
This library contains integration classes to use a timer or set a variable, or send data to other AWS resources. AWS IoT Events can trigger actions when it detects a specified event or transition event.
Currently supported are:
The code snippet below creates an Action that set variable to detector instanse when it is triggered.
// Example automatically generated from non-compiling source. May contain errors.
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
IInput input;
State state = State.Builder.create()
.stateName("MyState")
.onEnter(List.of(Event.builder()
.eventName("test-event")
.condition(Expression.currentInput(input))
.actions(List.of(actions, List.of(
new SetVariableAction("MyVariable", Expression.inputAttribute(input, "payload.temperature")))))
.build()))
.build();
The code snippet below creates an Action that invoke a Lambda function when it is triggered.
// Example automatically generated from non-compiling source. May contain errors.
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.core.*;
IInput input;
IFunction func;
State state = State.Builder.create()
.stateName("MyState")
.onEnter(List.of(Event.builder()
.eventName("test-event")
.condition(Expression.currentInput(input))
.actions(List.of(new LambdaInvokeAction(func)))
.build()))
.build();
Copyright © 2022. All rights reserved.