Class CfnDetectorModelPropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
You create a detector model (a model of your equipment or process) using states . For each state, you define conditional (Boolean) logic that evaluates the incoming inputs to detect significant events. When an event is detected, it can change the state or trigger custom-built or predefined actions using other AWS services. You can define additional events that trigger actions when entering or exiting a state and, optionally, when a condition is met. For more information, see How to Use AWS IoT Events in the AWS IoT Events Developer Guide .
When you successfully update a detector model (using the AWS IoT Events console, AWS IoT Events API or CLI commands, or CloudFormation ) all detector instances created by the model are reset to their initial states. (The detector's
state, and the values of any variables and timers are reset.)When you successfully update a detector model (using the AWS IoT Events console, AWS IoT Events API or CLI commands, or CloudFormation ) the version number of the detector model is incremented. (A detector model with version number 1 before the update has version number 2 after the update succeeds.)
If you attempt to update a detector model using CloudFormation and the update does not succeed, the system may, in some cases, restore the original detector model. When this occurs, the detector model's version is incremented twice (for example, from version 1 to version 3) and the detector instances are reset.
Also, be aware that if you attempt to update several detector models at once using CloudFormation , some updates may succeed and others fail. In this case, the effects on each detector model's detector instances and version number depend on whether the update succeeded or failed, with the results as stated.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cfnpropertymixins.services.iotevents.*;
import software.amazon.awscdk.*;
IMergeStrategy mergeStrategy;
CfnDetectorModelPropsMixin cfnDetectorModelPropsMixin = CfnDetectorModelPropsMixin.Builder.create(CfnDetectorModelMixinProps.builder()
.detectorModelDefinition(DetectorModelDefinitionProperty.builder()
.initialStateName("initialStateName")
.states(List.of(StateProperty.builder()
.onEnter(OnEnterProperty.builder()
.events(List.of(EventProperty.builder()
.actions(List.of(ActionProperty.builder()
.clearTimer(ClearTimerProperty.builder()
.timerName("timerName")
.build())
.dynamoDb(DynamoDBProperty.builder()
.hashKeyField("hashKeyField")
.hashKeyType("hashKeyType")
.hashKeyValue("hashKeyValue")
.operation("operation")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.payloadField("payloadField")
.rangeKeyField("rangeKeyField")
.rangeKeyType("rangeKeyType")
.rangeKeyValue("rangeKeyValue")
.tableName("tableName")
.build())
.dynamoDBv2(DynamoDBv2Property.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.tableName("tableName")
.build())
.firehose(FirehoseProperty.builder()
.deliveryStreamName("deliveryStreamName")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.separator("separator")
.build())
.iotEvents(IotEventsProperty.builder()
.inputName("inputName")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.iotSiteWise(IotSiteWiseProperty.builder()
.assetId("assetId")
.entryId("entryId")
.propertyAlias("propertyAlias")
.propertyId("propertyId")
.propertyValue(AssetPropertyValueProperty.builder()
.quality("quality")
.timestamp(AssetPropertyTimestampProperty.builder()
.offsetInNanos("offsetInNanos")
.timeInSeconds("timeInSeconds")
.build())
.value(AssetPropertyVariantProperty.builder()
.booleanValue("booleanValue")
.doubleValue("doubleValue")
.integerValue("integerValue")
.stringValue("stringValue")
.build())
.build())
.build())
.iotTopicPublish(IotTopicPublishProperty.builder()
.mqttTopic("mqttTopic")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.lambda(LambdaProperty.builder()
.functionArn("functionArn")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.resetTimer(ResetTimerProperty.builder()
.timerName("timerName")
.build())
.setTimer(SetTimerProperty.builder()
.durationExpression("durationExpression")
.seconds(123)
.timerName("timerName")
.build())
.setVariable(SetVariableProperty.builder()
.value("value")
.variableName("variableName")
.build())
.sns(SnsProperty.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.targetArn("targetArn")
.build())
.sqs(SqsProperty.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.queueUrl("queueUrl")
.useBase64(false)
.build())
.build()))
.condition("condition")
.eventName("eventName")
.build()))
.build())
.onExit(OnExitProperty.builder()
.events(List.of(EventProperty.builder()
.actions(List.of(ActionProperty.builder()
.clearTimer(ClearTimerProperty.builder()
.timerName("timerName")
.build())
.dynamoDb(DynamoDBProperty.builder()
.hashKeyField("hashKeyField")
.hashKeyType("hashKeyType")
.hashKeyValue("hashKeyValue")
.operation("operation")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.payloadField("payloadField")
.rangeKeyField("rangeKeyField")
.rangeKeyType("rangeKeyType")
.rangeKeyValue("rangeKeyValue")
.tableName("tableName")
.build())
.dynamoDBv2(DynamoDBv2Property.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.tableName("tableName")
.build())
.firehose(FirehoseProperty.builder()
.deliveryStreamName("deliveryStreamName")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.separator("separator")
.build())
.iotEvents(IotEventsProperty.builder()
.inputName("inputName")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.iotSiteWise(IotSiteWiseProperty.builder()
.assetId("assetId")
.entryId("entryId")
.propertyAlias("propertyAlias")
.propertyId("propertyId")
.propertyValue(AssetPropertyValueProperty.builder()
.quality("quality")
.timestamp(AssetPropertyTimestampProperty.builder()
.offsetInNanos("offsetInNanos")
.timeInSeconds("timeInSeconds")
.build())
.value(AssetPropertyVariantProperty.builder()
.booleanValue("booleanValue")
.doubleValue("doubleValue")
.integerValue("integerValue")
.stringValue("stringValue")
.build())
.build())
.build())
.iotTopicPublish(IotTopicPublishProperty.builder()
.mqttTopic("mqttTopic")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.lambda(LambdaProperty.builder()
.functionArn("functionArn")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.resetTimer(ResetTimerProperty.builder()
.timerName("timerName")
.build())
.setTimer(SetTimerProperty.builder()
.durationExpression("durationExpression")
.seconds(123)
.timerName("timerName")
.build())
.setVariable(SetVariableProperty.builder()
.value("value")
.variableName("variableName")
.build())
.sns(SnsProperty.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.targetArn("targetArn")
.build())
.sqs(SqsProperty.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.queueUrl("queueUrl")
.useBase64(false)
.build())
.build()))
.condition("condition")
.eventName("eventName")
.build()))
.build())
.onInput(OnInputProperty.builder()
.events(List.of(EventProperty.builder()
.actions(List.of(ActionProperty.builder()
.clearTimer(ClearTimerProperty.builder()
.timerName("timerName")
.build())
.dynamoDb(DynamoDBProperty.builder()
.hashKeyField("hashKeyField")
.hashKeyType("hashKeyType")
.hashKeyValue("hashKeyValue")
.operation("operation")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.payloadField("payloadField")
.rangeKeyField("rangeKeyField")
.rangeKeyType("rangeKeyType")
.rangeKeyValue("rangeKeyValue")
.tableName("tableName")
.build())
.dynamoDBv2(DynamoDBv2Property.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.tableName("tableName")
.build())
.firehose(FirehoseProperty.builder()
.deliveryStreamName("deliveryStreamName")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.separator("separator")
.build())
.iotEvents(IotEventsProperty.builder()
.inputName("inputName")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.iotSiteWise(IotSiteWiseProperty.builder()
.assetId("assetId")
.entryId("entryId")
.propertyAlias("propertyAlias")
.propertyId("propertyId")
.propertyValue(AssetPropertyValueProperty.builder()
.quality("quality")
.timestamp(AssetPropertyTimestampProperty.builder()
.offsetInNanos("offsetInNanos")
.timeInSeconds("timeInSeconds")
.build())
.value(AssetPropertyVariantProperty.builder()
.booleanValue("booleanValue")
.doubleValue("doubleValue")
.integerValue("integerValue")
.stringValue("stringValue")
.build())
.build())
.build())
.iotTopicPublish(IotTopicPublishProperty.builder()
.mqttTopic("mqttTopic")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.lambda(LambdaProperty.builder()
.functionArn("functionArn")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.resetTimer(ResetTimerProperty.builder()
.timerName("timerName")
.build())
.setTimer(SetTimerProperty.builder()
.durationExpression("durationExpression")
.seconds(123)
.timerName("timerName")
.build())
.setVariable(SetVariableProperty.builder()
.value("value")
.variableName("variableName")
.build())
.sns(SnsProperty.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.targetArn("targetArn")
.build())
.sqs(SqsProperty.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.queueUrl("queueUrl")
.useBase64(false)
.build())
.build()))
.condition("condition")
.eventName("eventName")
.build()))
.transitionEvents(List.of(TransitionEventProperty.builder()
.actions(List.of(ActionProperty.builder()
.clearTimer(ClearTimerProperty.builder()
.timerName("timerName")
.build())
.dynamoDb(DynamoDBProperty.builder()
.hashKeyField("hashKeyField")
.hashKeyType("hashKeyType")
.hashKeyValue("hashKeyValue")
.operation("operation")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.payloadField("payloadField")
.rangeKeyField("rangeKeyField")
.rangeKeyType("rangeKeyType")
.rangeKeyValue("rangeKeyValue")
.tableName("tableName")
.build())
.dynamoDBv2(DynamoDBv2Property.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.tableName("tableName")
.build())
.firehose(FirehoseProperty.builder()
.deliveryStreamName("deliveryStreamName")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.separator("separator")
.build())
.iotEvents(IotEventsProperty.builder()
.inputName("inputName")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.iotSiteWise(IotSiteWiseProperty.builder()
.assetId("assetId")
.entryId("entryId")
.propertyAlias("propertyAlias")
.propertyId("propertyId")
.propertyValue(AssetPropertyValueProperty.builder()
.quality("quality")
.timestamp(AssetPropertyTimestampProperty.builder()
.offsetInNanos("offsetInNanos")
.timeInSeconds("timeInSeconds")
.build())
.value(AssetPropertyVariantProperty.builder()
.booleanValue("booleanValue")
.doubleValue("doubleValue")
.integerValue("integerValue")
.stringValue("stringValue")
.build())
.build())
.build())
.iotTopicPublish(IotTopicPublishProperty.builder()
.mqttTopic("mqttTopic")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.lambda(LambdaProperty.builder()
.functionArn("functionArn")
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build())
.resetTimer(ResetTimerProperty.builder()
.timerName("timerName")
.build())
.setTimer(SetTimerProperty.builder()
.durationExpression("durationExpression")
.seconds(123)
.timerName("timerName")
.build())
.setVariable(SetVariableProperty.builder()
.value("value")
.variableName("variableName")
.build())
.sns(SnsProperty.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.targetArn("targetArn")
.build())
.sqs(SqsProperty.builder()
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.queueUrl("queueUrl")
.useBase64(false)
.build())
.build()))
.condition("condition")
.eventName("eventName")
.nextState("nextState")
.build()))
.build())
.stateName("stateName")
.build()))
.build())
.detectorModelDescription("detectorModelDescription")
.detectorModelName("detectorModelName")
.evaluationMethod("evaluationMethod")
.key("key")
.roleArn("roleArn")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn action to be performed when theconditionis TRUE.static interfaceA structure that contains timestamp information.static interfaceA structure that contains value information.static interfaceA structure that contains an asset property value.static final classA fluent builder forCfnDetectorModelPropsMixin.static interfaceInformation needed to clear the timer.static interfaceInformation that defines how a detector operates.static interfaceDefines an action to write to the Amazon DynamoDB table that you created.static interfaceDefines an action to write to the Amazon DynamoDB table that you created.static interfaceSpecifies theactionsto be performed when theconditionevaluates to TRUE.static interfaceSends information about the detector model instance and the event that triggered the action to an Amazon Kinesis Data Firehose delivery stream.static interfaceSends an AWS IoT Events input, passing in information about the detector model instance and the event that triggered the action.static interfaceSends information about the detector model instance and the event that triggered the action to a specified asset property in AWS IoT SiteWise .static interfaceInformation required to publish the MQTT message through the AWS IoT message broker.static interfaceCalls a Lambda function, passing in information about the detector model instance and the event that triggered the action.static interfaceWhen entering this state, perform theseactionsif theconditionis TRUE.static interfaceWhen exiting this state, perform theseactionsif the specifiedconditionisTRUE.static interfaceSpecifies the actions performed when theconditionevaluates to TRUE.static interfaceInformation needed to configure the payload.static interfaceInformation required to reset the timer.static interfaceInformation needed to set the timer.static interfaceInformation about the variable and its new value.static interfaceInformation required to publish the Amazon SNS message.static interfaceSends information about the detector model instance and the event that triggered the action to an Amazon SQS queue.static interfaceInformation that defines a state of a detector.static interfaceSpecifies the actions performed and the next state entered when aconditionevaluates to TRUE.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::IoTEvents::DetectorModel.Create a mixin to apply properties toAWS::IoTEvents::DetectorModel.protectedCfnDetectorModelPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDetectorModelPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnDetectorModelMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnDetectorModelPropsMixin
protected CfnDetectorModelPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnDetectorModelPropsMixin
protected CfnDetectorModelPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnDetectorModelPropsMixin
@Stability(Stable) public CfnDetectorModelPropsMixin(@NotNull CfnDetectorModelMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::IoTEvents::DetectorModel.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnDetectorModelPropsMixin
Create a mixin to apply properties toAWS::IoTEvents::DetectorModel.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-