log_anomaly_detectors
Creates, updates, deletes or gets a log_anomaly_detector
resource or lists log_anomaly_detectors
in a region
Overview
Name | log_anomaly_detectors |
Type | Resource |
Description | The AWS::Logs::LogAnomalyDetector resource specifies a CloudWatch Logs LogAnomalyDetector. |
Id | aws.logs.log_anomaly_detectors |
Fields
Name | Datatype | Description |
---|---|---|
account_id | string | Account ID for owner of detector |
kms_key_id | string | The Amazon Resource Name (ARN) of the CMK to use when encrypting log data. |
detector_name | string | Name of detector |
log_group_arn_list | array | List of Arns for the given log group |
evaluation_frequency | string | How often log group is evaluated |
filter_pattern | string | |
anomaly_detector_status | string | Current status of detector. |
anomaly_visibility_time | number | |
creation_time_stamp | number | When detector was created. |
last_modified_time_stamp | number | When detector was lsat modified. |
anomaly_detector_arn | string | ARN of LogAnomalyDetector |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | , 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 log_anomaly_detectors
in a region.
SELECT
region,
account_id,
kms_key_id,
detector_name,
log_group_arn_list,
evaluation_frequency,
filter_pattern,
anomaly_detector_status,
anomaly_visibility_time,
creation_time_stamp,
last_modified_time_stamp,
anomaly_detector_arn
FROM aws.logs.log_anomaly_detectors
WHERE region = 'us-east-1';
Gets all properties from an individual log_anomaly_detector
.
SELECT
region,
account_id,
kms_key_id,
detector_name,
log_group_arn_list,
evaluation_frequency,
filter_pattern,
anomaly_detector_status,
anomaly_visibility_time,
creation_time_stamp,
last_modified_time_stamp,
anomaly_detector_arn
FROM aws.logs.log_anomaly_detectors
WHERE region = 'us-east-1' AND data__Identifier = '<AnomalyDetectorArn>';
INSERT
example
Use the following StackQL query and manifest file to create a new log_anomaly_detector
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.logs.log_anomaly_detectors (
,
region
)
SELECT
'{{ }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.logs.log_anomaly_detectors (
AccountId,
KmsKeyId,
DetectorName,
LogGroupArnList,
EvaluationFrequency,
FilterPattern,
AnomalyVisibilityTime,
region
)
SELECT
'{{ AccountId }}',
'{{ KmsKeyId }}',
'{{ DetectorName }}',
'{{ LogGroupArnList }}',
'{{ EvaluationFrequency }}',
'{{ FilterPattern }}',
'{{ AnomalyVisibilityTime }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: log_anomaly_detector
props:
- name: AccountId
value: '{{ AccountId }}'
- name: KmsKeyId
value: '{{ KmsKeyId }}'
- name: DetectorName
value: '{{ DetectorName }}'
- name: LogGroupArnList
value:
- '{{ LogGroupArnList[0] }}'
- name: EvaluationFrequency
value: '{{ EvaluationFrequency }}'
- name: FilterPattern
value: '{{ FilterPattern }}'
- name: AnomalyVisibilityTime
value: null
DELETE
example
/*+ delete */
DELETE FROM aws.logs.log_anomaly_detectors
WHERE data__Identifier = '<AnomalyDetectorArn>'
AND region = 'us-east-1';
Permissions
To operate on the log_anomaly_detectors
resource, the following permissions are required:
Create
logs:CreateLogAnomalyDetector
Read
logs:GetLogAnomalyDetector
Update
logs:UpdateLogAnomalyDetector
Delete
logs:DeleteLogAnomalyDetector
List
logs:ListLogAnomalyDetectors