anomaly_monitors
Creates, updates, deletes or gets an anomaly_monitor
resource or lists anomaly_monitors
in a region
Overview
Name | anomaly_monitors |
Type | Resource |
Description | AWS Cost Anomaly Detection leverages advanced Machine Learning technologies to identify anomalous spend and root causes, so you can quickly take action. You can use Cost Anomaly Detection by creating monitor. |
Id | aws.ce.anomaly_monitors |
Fields
Name | Datatype | Description |
---|---|---|
monitor_arn | string | Subscription ARN |
monitor_type | string | |
monitor_name | string | The name of the monitor. |
creation_date | string | The date when the monitor was created. |
last_evaluated_date | string | The date when the monitor last evaluated for anomalies. |
last_updated_date | string | The date when the monitor was last updated. |
monitor_dimension | string | The dimensions to evaluate |
monitor_specification | string | |
dimensional_value_count | integer | The value for evaluated dimensions. |
resource_tags | array | Tags to assign to monitor. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | MonitorName, MonitorType, 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_monitors
in a region.
SELECT
region,
monitor_arn,
monitor_type,
monitor_name,
creation_date,
last_evaluated_date,
last_updated_date,
monitor_dimension,
monitor_specification,
dimensional_value_count,
resource_tags
FROM aws.ce.anomaly_monitors
WHERE region = 'us-east-1';
Gets all properties from an individual anomaly_monitor
.
SELECT
region,
monitor_arn,
monitor_type,
monitor_name,
creation_date,
last_evaluated_date,
last_updated_date,
monitor_dimension,
monitor_specification,
dimensional_value_count,
resource_tags
FROM aws.ce.anomaly_monitors
WHERE region = 'us-east-1' AND data__Identifier = '<MonitorArn>';
INSERT
example
Use the following StackQL query and manifest file to create a new anomaly_monitor
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ce.anomaly_monitors (
MonitorType,
MonitorName,
region
)
SELECT
'{{ MonitorType }}',
'{{ MonitorName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ce.anomaly_monitors (
MonitorType,
MonitorName,
MonitorDimension,
MonitorSpecification,
ResourceTags,
region
)
SELECT
'{{ MonitorType }}',
'{{ MonitorName }}',
'{{ MonitorDimension }}',
'{{ MonitorSpecification }}',
'{{ ResourceTags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: anomaly_monitor
props:
- name: MonitorType
value: '{{ MonitorType }}'
- name: MonitorName
value: '{{ MonitorName }}'
- name: MonitorDimension
value: '{{ MonitorDimension }}'
- name: MonitorSpecification
value: '{{ MonitorSpecification }}'
- name: ResourceTags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ce.anomaly_monitors
WHERE data__Identifier = '<MonitorArn>'
AND region = 'us-east-1';
Permissions
To operate on the anomaly_monitors
resource, the following permissions are required:
Create
ce:CreateAnomalyMonitor,
ce:TagResource
Read
ce:GetAnomalyMonitors
Update
ce:UpdateAnomalyMonitor
Delete
ce:DeleteAnomalyMonitor
List
ce:GetAnomalyMonitors