@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-05-19T23:09:24.219Z") @Stability(value=Stable) public class CfnDetectorModel extends CfnResource implements IInspectable
The AWS::IoTEvents::DetectorModel resource creates a detector model. 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 AWS 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 AWS 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 AWS 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 AWS 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.services.iotevents.*; CfnDetectorModel cfnDetectorModel = CfnDetectorModel.Builder.create(this, "MyCfnDetectorModel") .detectorModelDefinition(DetectorModelDefinitionProperty.builder() .initialStateName("initialStateName") .states(List.of(StateProperty.builder() .stateName("stateName") // the properties below are optional .onEnter(OnEnterProperty.builder() .events(List.of(EventProperty.builder() .eventName("eventName") // the properties below are optional .actions(List.of(ActionProperty.builder() .clearTimer(ClearTimerProperty.builder() .timerName("timerName") .build()) .dynamoDb(DynamoDBProperty.builder() .hashKeyField("hashKeyField") .hashKeyValue("hashKeyValue") .tableName("tableName") // the properties below are optional .hashKeyType("hashKeyType") .operation("operation") .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .payloadField("payloadField") .rangeKeyField("rangeKeyField") .rangeKeyType("rangeKeyType") .rangeKeyValue("rangeKeyValue") .build()) .dynamoDBv2(DynamoDBv2Property.builder() .tableName("tableName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .firehose(FirehoseProperty.builder() .deliveryStreamName("deliveryStreamName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .separator("separator") .build()) .iotEvents(IotEventsProperty.builder() .inputName("inputName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .iotSiteWise(IotSiteWiseProperty.builder() .propertyValue(AssetPropertyValueProperty.builder() .value(AssetPropertyVariantProperty.builder() .booleanValue("booleanValue") .doubleValue("doubleValue") .integerValue("integerValue") .stringValue("stringValue") .build()) // the properties below are optional .quality("quality") .timestamp(AssetPropertyTimestampProperty.builder() .timeInSeconds("timeInSeconds") // the properties below are optional .offsetInNanos("offsetInNanos") .build()) .build()) // the properties below are optional .assetId("assetId") .entryId("entryId") .propertyAlias("propertyAlias") .propertyId("propertyId") .build()) .iotTopicPublish(IotTopicPublishProperty.builder() .mqttTopic("mqttTopic") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .lambda(LambdaProperty.builder() .functionArn("functionArn") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .resetTimer(ResetTimerProperty.builder() .timerName("timerName") .build()) .setTimer(SetTimerProperty.builder() .timerName("timerName") // the properties below are optional .durationExpression("durationExpression") .seconds(123) .build()) .setVariable(SetVariableProperty.builder() .value("value") .variableName("variableName") .build()) .sns(SnsProperty.builder() .targetArn("targetArn") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .sqs(SqsProperty.builder() .queueUrl("queueUrl") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .useBase64(false) .build()) .build())) .condition("condition") .build())) .build()) .onExit(OnExitProperty.builder() .events(List.of(EventProperty.builder() .eventName("eventName") // the properties below are optional .actions(List.of(ActionProperty.builder() .clearTimer(ClearTimerProperty.builder() .timerName("timerName") .build()) .dynamoDb(DynamoDBProperty.builder() .hashKeyField("hashKeyField") .hashKeyValue("hashKeyValue") .tableName("tableName") // the properties below are optional .hashKeyType("hashKeyType") .operation("operation") .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .payloadField("payloadField") .rangeKeyField("rangeKeyField") .rangeKeyType("rangeKeyType") .rangeKeyValue("rangeKeyValue") .build()) .dynamoDBv2(DynamoDBv2Property.builder() .tableName("tableName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .firehose(FirehoseProperty.builder() .deliveryStreamName("deliveryStreamName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .separator("separator") .build()) .iotEvents(IotEventsProperty.builder() .inputName("inputName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .iotSiteWise(IotSiteWiseProperty.builder() .propertyValue(AssetPropertyValueProperty.builder() .value(AssetPropertyVariantProperty.builder() .booleanValue("booleanValue") .doubleValue("doubleValue") .integerValue("integerValue") .stringValue("stringValue") .build()) // the properties below are optional .quality("quality") .timestamp(AssetPropertyTimestampProperty.builder() .timeInSeconds("timeInSeconds") // the properties below are optional .offsetInNanos("offsetInNanos") .build()) .build()) // the properties below are optional .assetId("assetId") .entryId("entryId") .propertyAlias("propertyAlias") .propertyId("propertyId") .build()) .iotTopicPublish(IotTopicPublishProperty.builder() .mqttTopic("mqttTopic") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .lambda(LambdaProperty.builder() .functionArn("functionArn") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .resetTimer(ResetTimerProperty.builder() .timerName("timerName") .build()) .setTimer(SetTimerProperty.builder() .timerName("timerName") // the properties below are optional .durationExpression("durationExpression") .seconds(123) .build()) .setVariable(SetVariableProperty.builder() .value("value") .variableName("variableName") .build()) .sns(SnsProperty.builder() .targetArn("targetArn") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .sqs(SqsProperty.builder() .queueUrl("queueUrl") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .useBase64(false) .build()) .build())) .condition("condition") .build())) .build()) .onInput(OnInputProperty.builder() .events(List.of(EventProperty.builder() .eventName("eventName") // the properties below are optional .actions(List.of(ActionProperty.builder() .clearTimer(ClearTimerProperty.builder() .timerName("timerName") .build()) .dynamoDb(DynamoDBProperty.builder() .hashKeyField("hashKeyField") .hashKeyValue("hashKeyValue") .tableName("tableName") // the properties below are optional .hashKeyType("hashKeyType") .operation("operation") .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .payloadField("payloadField") .rangeKeyField("rangeKeyField") .rangeKeyType("rangeKeyType") .rangeKeyValue("rangeKeyValue") .build()) .dynamoDBv2(DynamoDBv2Property.builder() .tableName("tableName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .firehose(FirehoseProperty.builder() .deliveryStreamName("deliveryStreamName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .separator("separator") .build()) .iotEvents(IotEventsProperty.builder() .inputName("inputName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .iotSiteWise(IotSiteWiseProperty.builder() .propertyValue(AssetPropertyValueProperty.builder() .value(AssetPropertyVariantProperty.builder() .booleanValue("booleanValue") .doubleValue("doubleValue") .integerValue("integerValue") .stringValue("stringValue") .build()) // the properties below are optional .quality("quality") .timestamp(AssetPropertyTimestampProperty.builder() .timeInSeconds("timeInSeconds") // the properties below are optional .offsetInNanos("offsetInNanos") .build()) .build()) // the properties below are optional .assetId("assetId") .entryId("entryId") .propertyAlias("propertyAlias") .propertyId("propertyId") .build()) .iotTopicPublish(IotTopicPublishProperty.builder() .mqttTopic("mqttTopic") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .lambda(LambdaProperty.builder() .functionArn("functionArn") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .resetTimer(ResetTimerProperty.builder() .timerName("timerName") .build()) .setTimer(SetTimerProperty.builder() .timerName("timerName") // the properties below are optional .durationExpression("durationExpression") .seconds(123) .build()) .setVariable(SetVariableProperty.builder() .value("value") .variableName("variableName") .build()) .sns(SnsProperty.builder() .targetArn("targetArn") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .sqs(SqsProperty.builder() .queueUrl("queueUrl") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .useBase64(false) .build()) .build())) .condition("condition") .build())) .transitionEvents(List.of(TransitionEventProperty.builder() .condition("condition") .eventName("eventName") .nextState("nextState") // the properties below are optional .actions(List.of(ActionProperty.builder() .clearTimer(ClearTimerProperty.builder() .timerName("timerName") .build()) .dynamoDb(DynamoDBProperty.builder() .hashKeyField("hashKeyField") .hashKeyValue("hashKeyValue") .tableName("tableName") // the properties below are optional .hashKeyType("hashKeyType") .operation("operation") .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .payloadField("payloadField") .rangeKeyField("rangeKeyField") .rangeKeyType("rangeKeyType") .rangeKeyValue("rangeKeyValue") .build()) .dynamoDBv2(DynamoDBv2Property.builder() .tableName("tableName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .firehose(FirehoseProperty.builder() .deliveryStreamName("deliveryStreamName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .separator("separator") .build()) .iotEvents(IotEventsProperty.builder() .inputName("inputName") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .iotSiteWise(IotSiteWiseProperty.builder() .propertyValue(AssetPropertyValueProperty.builder() .value(AssetPropertyVariantProperty.builder() .booleanValue("booleanValue") .doubleValue("doubleValue") .integerValue("integerValue") .stringValue("stringValue") .build()) // the properties below are optional .quality("quality") .timestamp(AssetPropertyTimestampProperty.builder() .timeInSeconds("timeInSeconds") // the properties below are optional .offsetInNanos("offsetInNanos") .build()) .build()) // the properties below are optional .assetId("assetId") .entryId("entryId") .propertyAlias("propertyAlias") .propertyId("propertyId") .build()) .iotTopicPublish(IotTopicPublishProperty.builder() .mqttTopic("mqttTopic") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .lambda(LambdaProperty.builder() .functionArn("functionArn") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .resetTimer(ResetTimerProperty.builder() .timerName("timerName") .build()) .setTimer(SetTimerProperty.builder() .timerName("timerName") // the properties below are optional .durationExpression("durationExpression") .seconds(123) .build()) .setVariable(SetVariableProperty.builder() .value("value") .variableName("variableName") .build()) .sns(SnsProperty.builder() .targetArn("targetArn") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .build()) .sqs(SqsProperty.builder() .queueUrl("queueUrl") // the properties below are optional .payload(PayloadProperty.builder() .contentExpression("contentExpression") .type("type") .build()) .useBase64(false) .build()) .build())) .build())) .build()) .build())) .build()) .roleArn("roleArn") // the properties below are optional .detectorModelDescription("detectorModelDescription") .detectorModelName("detectorModelName") .evaluationMethod("evaluationMethod") .key("key") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static interface |
CfnDetectorModel.ActionProperty
An action to be performed when the `condition` is TRUE.
|
static interface |
CfnDetectorModel.AssetPropertyTimestampProperty
A structure that contains timestamp information.
|
static interface |
CfnDetectorModel.AssetPropertyValueProperty
A structure that contains value information.
|
static interface |
CfnDetectorModel.AssetPropertyVariantProperty
A structure that contains an asset property value.
|
static class |
CfnDetectorModel.Builder
A fluent builder for
CfnDetectorModel . |
static interface |
CfnDetectorModel.ClearTimerProperty
Information needed to clear the timer.
|
static interface |
CfnDetectorModel.DetectorModelDefinitionProperty
Information that defines how a detector operates.
|
static interface |
CfnDetectorModel.DynamoDBProperty
Defines an action to write to the Amazon DynamoDB table that you created.
|
static interface |
CfnDetectorModel.DynamoDBv2Property
Defines an action to write to the Amazon DynamoDB table that you created.
|
static interface |
CfnDetectorModel.EventProperty
Specifies the `actions` to be performed when the `condition` evaluates to TRUE.
|
static interface |
CfnDetectorModel.FirehoseProperty
Sends information about the detector model instance and the event that triggered the action to an Amazon Kinesis Data Firehose delivery stream.
|
static interface |
CfnDetectorModel.IotEventsProperty
Sends an AWS IoT Events input, passing in information about the detector model instance and the event that triggered the action.
|
static interface |
CfnDetectorModel.IotSiteWiseProperty
Sends information about the detector model instance and the event that triggered the action to a specified asset property in AWS IoT SiteWise .
|
static interface |
CfnDetectorModel.IotTopicPublishProperty
Information required to publish the MQTT message through the AWS IoT message broker.
|
static interface |
CfnDetectorModel.LambdaProperty
Calls a Lambda function, passing in information about the detector model instance and the event that triggered the action.
|
static interface |
CfnDetectorModel.OnEnterProperty
When entering this state, perform these `actions` if the `condition` is TRUE.
|
static interface |
CfnDetectorModel.OnExitProperty
When exiting this state, perform these `actions` if the specified `condition` is `TRUE` .
|
static interface |
CfnDetectorModel.OnInputProperty
Specifies the actions performed when the `condition` evaluates to TRUE.
|
static interface |
CfnDetectorModel.PayloadProperty
Information needed to configure the payload.
|
static interface |
CfnDetectorModel.ResetTimerProperty
Information required to reset the timer.
|
static interface |
CfnDetectorModel.SetTimerProperty
Information needed to set the timer.
|
static interface |
CfnDetectorModel.SetVariableProperty
Information about the variable and its new value.
|
static interface |
CfnDetectorModel.SnsProperty
Information required to publish the Amazon SNS message.
|
static interface |
CfnDetectorModel.SqsProperty
Sends information about the detector model instance and the event that triggered the action to an Amazon SQS queue.
|
static interface |
CfnDetectorModel.StateProperty
Information that defines a state of a detector.
|
static interface |
CfnDetectorModel.TransitionEventProperty
Specifies the actions performed and the next state entered when a `condition` evaluates to TRUE.
|
software.amazon.jsii.JsiiObject.InitializationMode
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnDetectorModel(Construct scope,
String id,
CfnDetectorModelProps props)
Create a new `AWS::IoTEvents::DetectorModel`.
|
protected |
CfnDetectorModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnDetectorModel(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
getCfnProperties() |
Object |
getDetectorModelDefinition()
Information that defines how a detector operates.
|
String |
getDetectorModelDescription()
A brief description of the detector model.
|
String |
getDetectorModelName()
The name of the detector model.
|
String |
getEvaluationMethod()
Information about the order in which events are evaluated and how actions are executed.
|
String |
getKey()
The value used to identify a detector instance.
|
String |
getRoleArn()
The ARN of the role that grants permission to AWS IoT Events to perform its operations.
|
TagManager |
getTags()
An array of key-value pairs to apply to this resource.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setDetectorModelDefinition(CfnDetectorModel.DetectorModelDefinitionProperty value)
Information that defines how a detector operates.
|
void |
setDetectorModelDefinition(IResolvable value)
Information that defines how a detector operates.
|
void |
setDetectorModelDescription(String value)
A brief description of the detector model.
|
void |
setDetectorModelName(String value)
The name of the detector model.
|
void |
setEvaluationMethod(String value)
Information about the order in which events are evaluated and how actions are executed.
|
void |
setKey(String value)
The value used to identify a detector instance.
|
void |
setRoleArn(String value)
The ARN of the role that grants permission to AWS IoT Events to perform its operations.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnDetectorModel(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnDetectorModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) public CfnDetectorModel(@NotNull Construct scope, @NotNull String id, @NotNull CfnDetectorModelProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.@Stability(value=Stable) public void inspect(@NotNull TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties
in class CfnResource
@Stability(value=Stable) @NotNull public TagManager getTags()
For more information, see Tag .
@Stability(value=Stable) @NotNull public Object getDetectorModelDefinition()
@Stability(value=Stable) public void setDetectorModelDefinition(@NotNull IResolvable value)
@Stability(value=Stable) public void setDetectorModelDefinition(@NotNull CfnDetectorModel.DetectorModelDefinitionProperty value)
@Stability(value=Stable) @NotNull public String getRoleArn()
@Stability(value=Stable) public void setRoleArn(@NotNull String value)
@Stability(value=Stable) @Nullable public String getDetectorModelDescription()
@Stability(value=Stable) public void setDetectorModelDescription(@Nullable String value)
@Stability(value=Stable) @Nullable public String getDetectorModelName()
@Stability(value=Stable) public void setDetectorModelName(@Nullable String value)
@Stability(value=Stable) @Nullable public String getEvaluationMethod()
@Stability(value=Stable) public void setEvaluationMethod(@Nullable String value)
@Stability(value=Stable) @Nullable public String getKey()
When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.
This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.
@Stability(value=Stable) public void setKey(@Nullable String value)
When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.
This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.
Copyright © 2023. All rights reserved.