alerts
Creates, updates, deletes or gets an alert
resource or lists alerts
in a region
Overview
Name | alerts |
Type | Resource |
Description | Resource Type definition for AWS::LookoutMetrics::Alert |
Id | aws.lookoutmetrics.alerts |
Fields
Name | Datatype | Description |
---|---|---|
alert_name | string | The name of the alert. If not provided, a name is generated automatically. |
arn | string | ARN assigned to the alert. |
alert_description | string | A description for the alert. |
anomaly_detector_arn | string | The Amazon resource name (ARN) of the Anomaly Detector to alert. |
alert_sensitivity_threshold | integer | A number between 0 and 100 (inclusive) that tunes the sensitivity of the alert. |
action | object | The action to be taken by the alert when an anomaly is detected. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AnomalyDetectorArn, AlertSensitivityThreshold, Action, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all alerts
in a region.
SELECT
region,
alert_name,
arn,
alert_description,
anomaly_detector_arn,
alert_sensitivity_threshold,
action
FROM aws.lookoutmetrics.alerts
WHERE region = 'us-east-1';
Gets all properties from an individual alert
.
SELECT
region,
alert_name,
arn,
alert_description,
anomaly_detector_arn,
alert_sensitivity_threshold,
action
FROM aws.lookoutmetrics.alerts
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
INSERT
example
Use the following StackQL query and manifest file to create a new alert
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.lookoutmetrics.alerts (
AnomalyDetectorArn,
AlertSensitivityThreshold,
Action,
region
)
SELECT
'{{ AnomalyDetectorArn }}',
'{{ AlertSensitivityThreshold }}',
'{{ Action }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.lookoutmetrics.alerts (
AlertName,
AlertDescription,
AnomalyDetectorArn,
AlertSensitivityThreshold,
Action,
region
)
SELECT
'{{ AlertName }}',
'{{ AlertDescription }}',
'{{ AnomalyDetectorArn }}',
'{{ AlertSensitivityThreshold }}',
'{{ Action }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: alert
props:
- name: AlertName
value: '{{ AlertName }}'
- name: AlertDescription
value: '{{ AlertDescription }}'
- name: AnomalyDetectorArn
value: '{{ AnomalyDetectorArn }}'
- name: AlertSensitivityThreshold
value: '{{ AlertSensitivityThreshold }}'
- name: Action
value:
SNSConfiguration:
RoleArn: '{{ RoleArn }}'
SnsTopicArn: null
LambdaConfiguration:
RoleArn: null
LambdaArn: null
DELETE
example
/*+ delete */
DELETE FROM aws.lookoutmetrics.alerts
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the alerts
resource, the following permissions are required:
Create
lookoutmetrics:CreateAlert,
iam:PassRole
Read
lookoutmetrics:DescribeAlert
Delete
lookoutmetrics:DeleteAlert
List
lookoutmetrics:ListAlerts