Skip to main content

alerts

Creates, updates, deletes or gets an alert resource or lists alerts in a region

Overview

Namealerts
TypeResource
DescriptionResource Type definition for AWS::LookoutMetrics::Alert
Idaws.lookoutmetrics.alerts

Fields

NameDatatypeDescription
alert_namestringThe name of the alert. If not provided, a name is generated automatically.
arnstringARN assigned to the alert.
alert_descriptionstringA description for the alert.
anomaly_detector_arnstringThe Amazon resource name (ARN) of the Anomaly Detector to alert.
alert_sensitivity_thresholdintegerA number between 0 and 100 (inclusive) that tunes the sensitivity of the alert.
actionobjectThe action to be taken by the alert when an anomaly is detected.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTAnomalyDetectorArn, AlertSensitivityThreshold, Action, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.lookoutmetrics.alerts (
AnomalyDetectorArn,
AlertSensitivityThreshold,
Action,
region
)
SELECT
'{{ AnomalyDetectorArn }}',
'{{ AlertSensitivityThreshold }}',
'{{ Action }}',
'{{ region }}';

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