Skip to main content

anomaly_detectors

Creates, updates, deletes or gets an anomaly_detector resource or lists anomaly_detectors in a region

Overview

Nameanomaly_detectors
TypeResource
DescriptionAn Amazon Lookout for Metrics Detector
Idaws.lookoutmetrics.anomaly_detectors

Fields

NameDatatypeDescription
arnstring
anomaly_detector_namestringName for the Amazon Lookout for Metrics Anomaly Detector
anomaly_detector_descriptionstringA description for the AnomalyDetector.
anomaly_detector_configobjectConfiguration options for the AnomalyDetector
metric_set_listarrayList of metric sets for anomaly detection
kms_key_arnstringKMS key used to encrypt the AnomalyDetector data
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTAnomalyDetectorConfig, MetricSetList, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all anomaly_detectors in a region.

SELECT
region,
arn,
anomaly_detector_name,
anomaly_detector_description,
anomaly_detector_config,
metric_set_list,
kms_key_arn
FROM aws.lookoutmetrics.anomaly_detectors
WHERE region = 'us-east-1';

Gets all properties from an individual anomaly_detector.

SELECT
region,
arn,
anomaly_detector_name,
anomaly_detector_description,
anomaly_detector_config,
metric_set_list,
kms_key_arn
FROM aws.lookoutmetrics.anomaly_detectors
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';

INSERT example

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

/*+ create */
INSERT INTO aws.lookoutmetrics.anomaly_detectors (
AnomalyDetectorConfig,
MetricSetList,
region
)
SELECT
'{{ AnomalyDetectorConfig }}',
'{{ MetricSetList }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.lookoutmetrics.anomaly_detectors
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

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

Create

lookoutmetrics:CreateAnomalyDetector,
lookoutmetrics:DeleteAnomalyDetector,
lookoutmetrics:CreateMetricSet,
iam:PassRole

Read

lookoutmetrics:DescribeAnomalyDetector,
lookoutmetrics:DescribeMetricSet,
lookoutmetrics:ListMetricSets

Update

lookoutmetrics:UpdateAnomalyDetector,
lookoutmetrics:UpdateMetricSet

Delete

lookoutmetrics:DescribeAnomalyDetector,
lookoutmetrics:DeleteAnomalyDetector

List

lookoutmetrics:ListAnomalyDetectors