resource "datadog_monitor" "virtualmachine_status" { count = var.status_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Virtual Machine is unreachable" message = coalesce(var.status_message, var.message) type = "query alert" query = < ${var.cpu_usage_threshold_critical} EOQ thresholds = { critical = var.cpu_usage_threshold_critical warning = var.cpu_usage_threshold_warning } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false tags = ["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform", var.cpu_usage_extra_tags] } resource "datadog_monitor" "virtualmachine_credit_cpu_remaining_too_low" { count = var.cpu_remaining_rate_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Virtual Machine credit CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.cpu_remaining_rate_message, var.message) type = "query alert" query = <