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 | Represents an alarm model to monitor an ITE input attribute. You can use the alarm to get notified when the value is outside a specified range. For more information, see [Create an alarm model](https://docs.aws.amazon.com/iotevents/latest/developerguide/create-alarms.html) in the *Developer Guide*. |
Id | aws.iotevents.alarm_models |
Fields
Name | Datatype | Description |
---|---|---|
alarm_model_name | string | The name of the alarm model. |
alarm_model_description | string | The description of the alarm model. |
role_arn | string | The ARN of the IAM role that allows the alarm to perform actions and access AWS resources. For more information, see [Amazon Resource Names (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *General Reference*. |
key | string | An input attribute used as a key to create an alarm. ITE routes [inputs](https://docs.aws.amazon.com/iotevents/latest/apireference/API_Input.html) associated with this key to the alarm. |
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 | A list of key-value pairs that contain metadata for the alarm model. The tags help you manage the alarm model. For more information, see [Tagging your resources](https://docs.aws.amazon.com/iotevents/latest/developerguide/tagging-iotevents.html) in the *Developer Guide*. You can create up to 50 tags for one alarm model. |
region | string | AWS region. |
For more information, see AWS::IoTEvents::AlarmModel
.
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