AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::IoTEvents::DetectorModel

CfnDetectorModel

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](https://docs.aws.amazon.com/iotevents/latest/developerguide/how-to-use-iotevents.html) 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.

Import

import { CfnDetectorModel } from 'aws-cdk-lib/aws-iotevents';

Or use the module namespace:

import * as iotevents from 'aws-cdk-lib/aws-iotevents';
// iotevents.CfnDetectorModel

Properties

Configuration passed to the constructor as CfnDetectorModelProps.

detectorModelDefinitionRequired
IResolvable | DetectorModelDefinitionProperty

Information that defines how a detector operates.

roleArnRequired
string | IRoleRef

The ARN of the role that grants permission to AWS IoT Events to perform its operations.

detectorModelDescriptionOptional
string

A brief description of the detector model.

detectorModelNameOptional
string

The name of the detector model.

evaluationMethodOptional
string

Information about the order in which events are evaluated and how actions are executed.

keyOptional
string

The value used to identify a detector instance. 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.

tagsOptional
CfnTag[]

An array of key-value pairs to apply to this resource. For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-iotevents
CFN TypeAWS::IoTEvents::DetectorModel
Properties7

Related Constructs

External Links