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.
Idawscc.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.

For more information, see AWS::CE::AnomalyMonitor.

Methods

NameResourceAccessible byRequired Params
create_resourceanomaly_monitorsINSERTMonitorName, MonitorType, region
delete_resourceanomaly_monitorsDELETEIdentifier, region
update_resourceanomaly_monitorsUPDATEIdentifier, PatchDocument, region
list_resourcesanomaly_monitors_list_onlySELECTregion
get_resourceanomaly_monitorsSELECTIdentifier, region

SELECT examples

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 = '{{ region }}' AND
Identifier = '{{ monitor_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new anomaly_monitor resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ce.anomaly_monitors (
MonitorType,
MonitorName,
region
)
SELECT
'{{ monitor_type }}',
'{{ monitor_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ce.anomaly_monitors
WHERE
Identifier = '{{ monitor_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the anomaly_monitors resource, the following permissions are required:

ce:CreateAnomalyMonitor,
ce:TagResource