Skip to main content

detector_models

Creates, updates, deletes or gets a detector_model resource or lists detector_models in a region

Overview

Namedetector_models
TypeResource
DescriptionThe 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*.
Idaws.iotevents.detector_models

Fields

NameDatatypeDescription
detector_model_definitionobjectInformation that defines how a detector operates.
detector_model_descriptionstringA brief description of the detector model.
detector_model_namestringThe name of the detector model.
evaluation_methodstringInformation about the order in which events are evaluated and how actions are executed.
keystringThe 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.
role_arnstringThe ARN of the role that grants permission to AWS IoT Events to perform its operations.
tagsarrayAn 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).
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTDetectorModelDefinition, RoleArn, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all detector_models in a region.

SELECT
region,
detector_model_definition,
detector_model_description,
detector_model_name,
evaluation_method,
key,
role_arn,
tags
FROM aws.iotevents.detector_models
WHERE region = 'us-east-1';

Gets all properties from an individual detector_model.

SELECT
region,
detector_model_definition,
detector_model_description,
detector_model_name,
evaluation_method,
key,
role_arn,
tags
FROM aws.iotevents.detector_models
WHERE region = 'us-east-1' AND data__Identifier = '<DetectorModelName>';

INSERT example

Use the following StackQL query and manifest file to create a new detector_model resource, using stack-deploy.

/*+ create */
INSERT INTO aws.iotevents.detector_models (
DetectorModelDefinition,
RoleArn,
region
)
SELECT
'{{ DetectorModelDefinition }}',
'{{ RoleArn }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.iotevents.detector_models
WHERE data__Identifier = '<DetectorModelName>'
AND region = 'us-east-1';

Permissions

To operate on the detector_models resource, the following permissions are required:

Create

iotevents:CreateDetectorModel,
iotevents:UpdateInputRouting,
iotevents:DescribeDetectorModel,
iotevents:ListTagsForResource,
iotevents:TagResource,
iam:PassRole

Read

iotevents:DescribeDetectorModel,
iotevents:ListTagsForResource

Update

iotevents:UpdateDetectorModel,
iotevents:UpdateInputRouting,
iotevents:DescribeDetectorModel,
iotevents:ListTagsForResource,
iotevents:UntagResource,
iotevents:TagResource,
iam:PassRole

Delete

iotevents:DeleteDetectorModel,
iotevents:DescribeDetectorModel

List

iotevents:ListDetectorModels