oci_budget_cost_anomaly_monitor
This resource provides the Cost Anomaly Monitor resource in Oracle Cloud Infrastructure Budget service. Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/budgets/latest/CostAnomalyMonitor
Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/budget
Creates a new costAnomaly Monitor.
Example Usage
resource "oci_budget_cost_anomaly_monitor" "test_cost_anomaly_monitor" {
#Required
compartment_id = var.compartment_id
name = var.cost_anomaly_monitor_name
target_resource_filter = var.cost_anomaly_monitor_target_resource_filter
#Optional
cost_alert_subscription_map {
#Optional
cost_alert_subscription_id = oci_budget_cost_alert_subscription.test_cost_alert_subscription.id
operator = var.cost_anomaly_monitor_cost_alert_subscription_map_operator
threshold_absolute_value = var.cost_anomaly_monitor_cost_alert_subscription_map_threshold_absolute_value
threshold_relative_percent = var.cost_anomaly_monitor_cost_alert_subscription_map_threshold_relative_percent
}
defined_tags = {"Operations.CostCenter"= "42"}
description = var.cost_anomaly_monitor_description
freeform_tags = {"Department"= "Finance"}
}
Argument Reference
The following arguments are supported:
compartment_id- (Required) The OCID of the compartment.cost_alert_subscription_map- (Optional) (Updatable) The mapping of cost monitor to alert subscription along with thresholds.cost_alert_subscription_id- (Optional) (Updatable) The costAlertSubscription ocid which the cost monitor alert maps to.operator- (Optional) (Updatable) The filter operator. Example: ‘AND’, ‘OR’.threshold_absolute_value- (Optional) (Updatable) The absolute threshold value.threshold_relative_percent- (Optional) (Updatable) The relative percentage threshold value.
defined_tags- (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:{"Operations.CostCenter": "42"}description- (Optional) (Updatable) The description of the cost anomaly monitor.freeform_tags- (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}name- (Required) The name of the cost anomaly monitor. Avoid entering confidential information.target_resource_filter- (Required) The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
Attributes Reference
The following attributes are exported:
compartment_id- The OCID of the compartment.cost_alert_subscription_map- The mapping of cost monitor to alert subscription along with thresholds.cost_alert_subscription_id- The costAlertSubscription ocid which the cost monitor alert maps to.operator- The filter operator. Example: ‘AND’, ‘OR’.threshold_absolute_value- The absolute threshold value.threshold_relative_percent- The relative percentage threshold value.
defined_tags- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:{"Operations.CostCenter": "42"}description- The description of the budget.freeform_tags- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}id- The OCID of the Cost Anomaly Monitor.lifecycle_details- The current state details of the cost monitor.name- The name of the cost anomaly monitor. Avoid entering confidential information.state- The current state of the cost monitor.system_tags- System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example:{"orcl-cloud.free-tier-retained": "true"}target_resource_filter- The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.time_created- The time that the cost monitor was created.time_updated- The time that the cost monitor was last updated.type- Type of cost monitor
Timeouts
The timeouts block allows you to specify timeouts for certain operations:
* create - (Defaults to 20 minutes), when creating the Cost Anomaly Monitor
* update - (Defaults to 20 minutes), when updating the Cost Anomaly Monitor
* delete - (Defaults to 20 minutes), when destroying the Cost Anomaly Monitor
Import
CostAnomalyMonitors can be imported using the id, e.g.
$ terraform import oci_budget_cost_anomaly_monitor.test_cost_anomaly_monitor "id"