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 | awscc.ce.anomaly_monitors |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
monitor_arn | string | Subscription ARN |
region | string | AWS region. |
For more information, see AWS::CE::AnomalyMonitor.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | anomaly_monitors | INSERT | MonitorName, MonitorType, region |
delete_resource | anomaly_monitors | DELETE | Identifier, region |
update_resource | anomaly_monitors | UPDATE | Identifier, PatchDocument, region |
list_resources | anomaly_monitors_list_only | SELECT | region |
get_resource | anomaly_monitors | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.ce.anomaly_monitors
WHERE
region = 'us-east-1' AND
Identifier = '{{ monitor_arn }}';
Lists all anomaly_monitors in a region.
SELECT
region,
monitor_arn
FROM awscc.ce.anomaly_monitors_list_only
WHERE
region = 'us-east-1';
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 awscc.ce.anomaly_monitors (
MonitorType,
MonitorName,
region
)
SELECT
'{{ monitor_type }}',
'{{ monitor_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ce.anomaly_monitors (
MonitorType,
MonitorName,
MonitorDimension,
MonitorSpecification,
ResourceTags,
region
)
SELECT
'{{ monitor_type }}',
'{{ monitor_name }}',
'{{ monitor_dimension }}',
'{{ monitor_specification }}',
'{{ resource_tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: anomaly_monitor
props:
- name: monitor_type
value: '{{ monitor_type }}'
- name: monitor_name
value: '{{ monitor_name }}'
- name: monitor_dimension
value: '{{ monitor_dimension }}'
- name: monitor_specification
value: '{{ monitor_specification }}'
- name: resource_tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a anomaly_monitor resource, using stack-deploy.
/*+ update */
UPDATE awscc.ce.anomaly_monitors
SET PatchDocument = string('{{ {
"MonitorName": monitor_name
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ monitor_arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.ce.anomaly_monitors
WHERE
Identifier = '{{ monitor_arn }}' AND
region = 'us-east-1';
Permissions
To operate on the anomaly_monitors resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ce:CreateAnomalyMonitor,
ce:TagResource
ce:GetAnomalyMonitors,
ce:ListTagsForResource
ce:UpdateAnomalyMonitor
ce:DeleteAnomalyMonitor
ce:GetAnomalyMonitors