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
DescriptionRepresents 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 in the Developer Guide.
Idawscc.iotevents.alarm_models

Fields

NameDatatypeDescription
alarm_model_namestringThe name of the alarm model.
alarm_model_descriptionstringThe description of the alarm model.
role_arnstringThe ARN of the IAM role that allows the alarm to perform actions and access AWS resources. For more information, see Amazon Resource Names (ARNs) in the General Reference.
keystringAn input attribute used as a key to create an alarm. ITE routes inputs associated with this key to the alarm.
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.
tagsarray
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 in the Developer Guide.You can create up to 50 tags for one alarm model.
regionstringAWS region.

For more information, see AWS::IoTEvents::AlarmModel.

Methods

NameResourceAccessible byRequired Params
create_resourcealarm_modelsINSERTRoleArn, AlarmRule, region
delete_resourcealarm_modelsDELETEIdentifier, region
update_resourcealarm_modelsUPDATEIdentifier, PatchDocument, region
list_resourcesalarm_models_list_onlySELECTregion
get_resourcealarm_modelsSELECTIdentifier, region

SELECT examples

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 awscc.iotevents.alarm_models
WHERE
region = '{{ region }}' AND
Identifier = '{{ alarm_model_name }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.iotevents.alarm_models (
RoleArn,
AlarmRule,
region
)
SELECT
'{{ role_arn }}',
'{{ alarm_rule }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

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

/*+ update */
UPDATE awscc.iotevents.alarm_models
SET PatchDocument = string('{{ {
"AlarmModelDescription": alarm_model_description,
"RoleArn": role_arn,
"Severity": severity,
"AlarmRule": alarm_rule,
"AlarmEventActions": alarm_event_actions,
"AlarmCapabilities": alarm_capabilities,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ alarm_model_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.iotevents.alarm_models
WHERE
Identifier = '{{ alarm_model_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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