anomaly_detectors
Creates, updates, deletes or gets an anomaly_detector
resource or lists anomaly_detectors
in a region
Overview
Name | anomaly_detectors |
Type | Resource |
Description | An Amazon Lookout for Metrics Detector |
Id | aws.lookoutmetrics.anomaly_detectors |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | |
anomaly_detector_name | string | Name for the Amazon Lookout for Metrics Anomaly Detector |
anomaly_detector_description | string | A description for the AnomalyDetector. |
anomaly_detector_config | object | Configuration options for the AnomalyDetector |
metric_set_list | array | List of metric sets for anomaly detection |
kms_key_arn | string | KMS key used to encrypt the AnomalyDetector data |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AnomalyDetectorConfig, MetricSetList, 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 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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.lookoutmetrics.anomaly_detectors (
AnomalyDetectorConfig,
MetricSetList,
region
)
SELECT
'{{ AnomalyDetectorConfig }}',
'{{ MetricSetList }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.lookoutmetrics.anomaly_detectors (
AnomalyDetectorName,
AnomalyDetectorDescription,
AnomalyDetectorConfig,
MetricSetList,
KmsKeyArn,
region
)
SELECT
'{{ AnomalyDetectorName }}',
'{{ AnomalyDetectorDescription }}',
'{{ AnomalyDetectorConfig }}',
'{{ MetricSetList }}',
'{{ KmsKeyArn }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: anomaly_detector
props:
- name: AnomalyDetectorName
value: '{{ AnomalyDetectorName }}'
- name: AnomalyDetectorDescription
value: '{{ AnomalyDetectorDescription }}'
- name: AnomalyDetectorConfig
value:
AnomalyDetectorFrequency: '{{ AnomalyDetectorFrequency }}'
- name: MetricSetList
value:
- MetricSetName: '{{ MetricSetName }}'
MetricSetDescription: '{{ MetricSetDescription }}'
MetricSource:
S3SourceConfig:
RoleArn: '{{ RoleArn }}'
TemplatedPathList:
- '{{ TemplatedPathList[0] }}'
HistoricalDataPathList:
- '{{ HistoricalDataPathList[0] }}'
FileFormatDescriptor:
CsvFormatDescriptor:
FileCompression: '{{ FileCompression }}'
Charset: '{{ Charset }}'
Delimiter: '{{ Delimiter }}'
HeaderList:
- '{{ HeaderList[0] }}'
QuoteSymbol: '{{ QuoteSymbol }}'
ContainsHeader: '{{ ContainsHeader }}'
JsonFormatDescriptor:
FileCompression: '{{ FileCompression }}'
Charset: null
RDSSourceConfig:
DBInstanceIdentifier: '{{ DBInstanceIdentifier }}'
DatabaseHost: '{{ DatabaseHost }}'
DatabasePort: '{{ DatabasePort }}'
SecretManagerArn: '{{ SecretManagerArn }}'
DatabaseName: '{{ DatabaseName }}'
TableName: '{{ TableName }}'
RoleArn: null
VpcConfiguration:
SubnetIdList:
- '{{ SubnetIdList[0] }}'
SecurityGroupIdList:
- '{{ SecurityGroupIdList[0] }}'
RedshiftSourceConfig:
ClusterIdentifier: '{{ ClusterIdentifier }}'
DatabaseHost: null
DatabasePort: null
SecretManagerArn: null
DatabaseName: '{{ DatabaseName }}'
TableName: null
RoleArn: null
VpcConfiguration: null
CloudwatchConfig:
RoleArn: null
AppFlowConfig:
RoleArn: null
FlowName: '{{ FlowName }}'
MetricList:
- MetricName: null
AggregationFunction: '{{ AggregationFunction }}'
Namespace: '{{ Namespace }}'
Offset: '{{ Offset }}'
TimestampColumn:
ColumnName: null
ColumnFormat: '{{ ColumnFormat }}'
DimensionList:
- null
MetricSetFrequency: '{{ MetricSetFrequency }}'
Timezone: '{{ Timezone }}'
- name: KmsKeyArn
value: '{{ KmsKeyArn }}'
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