Skip to main content

alarm_models

Creates, updates, deletes or gets an alarm_model resource or lists alarm_models in a region

Overview

Namealarm_models
TypeResource
DescriptionThe AWS::IoTEvents::AlarmModel resource creates a alarm model. AWS IoT Events alarms help you monitor your data for changes. The data can be metrics that you measure for your equipment and processes. You can create alarms that send notifications when a threshold is breached. Alarms help you detect issues, streamline maintenance, and optimize performance of your equipment and processes.
Alarms are instances of alarm models. The alarm model specifies what to detect, when to send notifications, who gets notified, and more. You can also specify one or more supported actions that occur when the alarm state changes. AWS IoT Events routes input attributes derived from your data to the appropriate alarms. If the data that you're monitoring is outside the specified range, the alarm is invoked. You can also acknowledge the alarms or set them to the snooze mode.
Idaws.iotevents.alarm_models

Fields

NameDatatypeDescription
alarm_model_namestringThe name of the alarm model.
alarm_model_descriptionstringA brief description of the alarm model.
role_arnstringThe ARN of the role that grants permission to AWS IoT Events to perform its operations.
keystringThe value used to identify a alarm instance. When a device or system sends input, a new alarm instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding alarm 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 alarm instance, the device must send a message payload that contains the same attribute-value.
severityintegerA non-negative integer that reflects the severity level of the alarm.
alarm_ruleobjectDefines when your alarm is invoked.
alarm_event_actionsobjectContains information about one or more alarm actions.
alarm_capabilitiesobjectContains the configuration information of alarm state changes
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_resourceINSERTRoleArn, AlarmRule, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all alarm_models in a region.

SELECT
region,
alarm_model_name,
alarm_model_description,
role_arn,
key,
severity,
alarm_rule,
alarm_event_actions,
alarm_capabilities,
tags
FROM aws.iotevents.alarm_models
WHERE region = 'us-east-1';

Gets all properties from an individual alarm_model.

SELECT
region,
alarm_model_name,
alarm_model_description,
role_arn,
key,
severity,
alarm_rule,
alarm_event_actions,
alarm_capabilities,
tags
FROM aws.iotevents.alarm_models
WHERE region = 'us-east-1' AND data__Identifier = '<AlarmModelName>';

INSERT example

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

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

DELETE example

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

Permissions

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

Create

iotevents:CreateAlarmModel,
iotevents:UpdateInputRouting,
iotevents:DescribeAlarmModel,
iotevents:ListTagsForResource,
iotevents:TagResource,
iam:PassRole

Read

iotevents:DescribeAlarmModel,
iotevents:ListTagsForResource

Update

iotevents:UpdateAlarmModel,
iotevents:UpdateInputRouting,
iotevents:DescribeAlarmModel,
iotevents:ListTagsForResource,
iotevents:UntagResource,
iotevents:TagResource,
iam:PassRole

Delete

iotevents:DeleteAlarmModel,
iotevents:DescribeAlarmModel

List

iotevents:ListAlarmModels