Skip to content

Resource: awsCeAnomalyMonitor

Provides a CE Anomaly Monitor.

Example Usage

There are two main types of a Cost Anomaly Monitor: dimensional and custom.

Dimensional Example

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.ceAnomalyMonitor.CeAnomalyMonitor(this, "service_monitor", {
  monitorDimension: "SERVICE",
  monitorType: "DIMENSIONAL",
  name: "AWSServiceMonitor",
});

Custom Example

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.ceAnomalyMonitor.CeAnomalyMonitor(this, "test", {
  monitorSpecification:
    '${jsonencode({\n    And            = null\n    CostCategories = null\n    Dimensions     = null\n    Not            = null\n    Or             = null\n\n    Tags = {\n      Key          = "CostCenter"\n      MatchOptions = null\n      Values = [\n        "10000"\n      ]\n    }\n  })}',
  monitorType: "CUSTOM",
  name: "AWSCustomAnomalyMonitor",
});

Argument Reference

The following arguments are required:

  • name - (Required) The name of the monitor.
  • monitorType - (Required) The possible type values. Valid values: dimensional | custom.
  • monitorDimension - (Required, if monitorType is dimensional) The dimensions to evaluate. Valid values: service.
  • monitorSpecification - (Required, if monitorType is custom) A valid JSON representation for the Expression object.
  • tags - (Optional) A map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - ARN of the anomaly monitor.
  • id - Unique ID of the anomaly monitor. Same as arn.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

awsCeAnomalyMonitor can be imported using the id, e.g.

$ terraform import aws_ce_anomaly_monitor.example costAnomalyMonitorARN