alarm_models
Creates, updates, deletes or gets an alarm_model
resource or lists alarm_models
in a region
Overview
Name | alarm_models |
Type | Resource |
Description | The 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. |
Id | aws.iotevents.alarm_models |
Fields
Name | Datatype | Description |
---|---|---|
alarm_model_name | string | The name of the alarm model. |
alarm_model_description | string | A brief description of the alarm model. |
role_arn | string | The ARN of the role that grants permission to AWS IoT Events to perform its operations. |
key | string | The 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. |
severity | integer | A non-negative integer that reflects the severity level of the alarm. |
alarm_rule | object | Defines when your alarm is invoked. |
alarm_event_actions | object | Contains information about one or more alarm actions. |
alarm_capabilities | object | Contains the configuration information of alarm state changes |
tags | array | 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). |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | RoleArn, AlarmRule, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iotevents.alarm_models (
RoleArn,
AlarmRule,
region
)
SELECT
'{{ RoleArn }}',
'{{ AlarmRule }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iotevents.alarm_models (
AlarmModelName,
AlarmModelDescription,
RoleArn,
Key,
Severity,
AlarmRule,
AlarmEventActions,
AlarmCapabilities,
Tags,
region
)
SELECT
'{{ AlarmModelName }}',
'{{ AlarmModelDescription }}',
'{{ RoleArn }}',
'{{ Key }}',
'{{ Severity }}',
'{{ AlarmRule }}',
'{{ AlarmEventActions }}',
'{{ AlarmCapabilities }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: alarm_model
props:
- name: AlarmModelName
value: '{{ AlarmModelName }}'
- name: AlarmModelDescription
value: '{{ AlarmModelDescription }}'
- name: RoleArn
value: '{{ RoleArn }}'
- name: Key
value: '{{ Key }}'
- name: Severity
value: '{{ Severity }}'
- name: AlarmRule
value:
SimpleRule:
InputProperty: '{{ InputProperty }}'
ComparisonOperator: '{{ ComparisonOperator }}'
Threshold: '{{ Threshold }}'
- name: AlarmEventActions
value:
AlarmActions:
- DynamoDB:
HashKeyField: '{{ HashKeyField }}'
HashKeyType: '{{ HashKeyType }}'
HashKeyValue: '{{ HashKeyValue }}'
Operation: '{{ Operation }}'
Payload:
ContentExpression: '{{ ContentExpression }}'
Type: '{{ Type }}'
PayloadField: '{{ PayloadField }}'
RangeKeyField: '{{ RangeKeyField }}'
RangeKeyType: '{{ RangeKeyType }}'
RangeKeyValue: '{{ RangeKeyValue }}'
TableName: '{{ TableName }}'
DynamoDBv2:
Payload: null
TableName: '{{ TableName }}'
Firehose:
DeliveryStreamName: '{{ DeliveryStreamName }}'
Payload: null
Separator: '{{ Separator }}'
IotEvents:
InputName: '{{ InputName }}'
Payload: null
IotSiteWise:
AssetId: '{{ AssetId }}'
EntryId: '{{ EntryId }}'
PropertyAlias: '{{ PropertyAlias }}'
PropertyId: '{{ PropertyId }}'
PropertyValue:
Quality: '{{ Quality }}'
Timestamp:
OffsetInNanos: '{{ OffsetInNanos }}'
TimeInSeconds: '{{ TimeInSeconds }}'
Value:
BooleanValue: '{{ BooleanValue }}'
DoubleValue: '{{ DoubleValue }}'
IntegerValue: '{{ IntegerValue }}'
StringValue: '{{ StringValue }}'
IotTopicPublish:
MqttTopic: '{{ MqttTopic }}'
Payload: null
Lambda:
FunctionArn: '{{ FunctionArn }}'
Payload: null
Sns:
Payload: null
TargetArn: '{{ TargetArn }}'
Sqs:
Payload: null
QueueUrl: '{{ QueueUrl }}'
UseBase64: '{{ UseBase64 }}'
- name: AlarmCapabilities
value:
InitializationConfiguration:
DisabledOnInitialization: '{{ DisabledOnInitialization }}'
AcknowledgeFlow:
Enabled: '{{ Enabled }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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