Skip to main content

anomaly_monitors

Creates, updates, deletes or gets an anomaly_monitor resource or lists anomaly_monitors in a region

Overview

Nameanomaly_monitors
TypeResource
DescriptionAWS 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.
Idaws.ce.anomaly_monitors

Fields

NameDatatypeDescription
monitor_arnstringSubscription ARN
monitor_typestring
monitor_namestringThe name of the monitor.
creation_datestringThe date when the monitor was created.
last_evaluated_datestringThe date when the monitor last evaluated for anomalies.
last_updated_datestringThe date when the monitor was last updated.
monitor_dimensionstringThe dimensions to evaluate
monitor_specificationstring
dimensional_value_countintegerThe value for evaluated dimensions.
resource_tagsarrayTags to assign to monitor.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTMonitorName, MonitorType, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.ce.anomaly_monitors (
MonitorType,
MonitorName,
region
)
SELECT
'{{ MonitorType }}',
'{{ MonitorName }}',
'{{ region }}';

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