resource "datadog_monitor" "ALB_no_healthy_instances" { count = var.alb_no_healthy_instances_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB healthy instances {{#is_alert}}is at 0{{/is_alert}}{{#is_warning}}is at {{value}}%%{{/is_warning}}" message = coalesce(var.alb_no_healthy_instances_message, var.message) type = "query alert" query = < ${var.latency_threshold_critical} EOQ monitor_thresholds { critical = var.latency_threshold_critical warning = var.latency_threshold_warning } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 require_full_window = false timeout_h = 0 include_tags = true tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.latency_extra_tags) } resource "datadog_monitor" "ALB_httpcode_5xx" { count = var.httpcode_alb_5xx_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB HTTP code 5xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.httpcode_alb_5xx_message, var.message) type = "query alert" query = < ${var.httpcode_alb_5xx_threshold_critical} EOQ monitor_thresholds { critical = var.httpcode_alb_5xx_threshold_critical warning = var.httpcode_alb_5xx_threshold_warning } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 require_full_window = false timeout_h = 0 include_tags = true tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_alb_5xx_extra_tags) } resource "datadog_monitor" "ALB_httpcode_4xx" { count = var.httpcode_alb_4xx_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.httpcode_alb_4xx_message, var.message) type = "query alert" query = < ${var.httpcode_alb_4xx_threshold_critical} EOQ monitor_thresholds { critical = var.httpcode_alb_4xx_threshold_critical warning = var.httpcode_alb_4xx_threshold_warning } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 require_full_window = false timeout_h = 0 include_tags = true tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_alb_4xx_extra_tags) } resource "datadog_monitor" "ALB_httpcode_target_5xx" { count = var.httpcode_target_5xx_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB target HTTP code 5xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.httpcode_target_5xx_message, var.message) type = "query alert" query = < ${var.httpcode_target_5xx_threshold_critical} EOQ monitor_thresholds { critical = var.httpcode_target_5xx_threshold_critical warning = var.httpcode_target_5xx_threshold_warning } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 require_full_window = false timeout_h = 0 include_tags = true tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_target_5xx_extra_tags) } resource "datadog_monitor" "ALB_httpcode_target_4xx" { count = var.httpcode_target_4xx_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] ALB target HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = coalesce(var.httpcode_target_4xx_message, var.message) type = "query alert" query = < ${var.httpcode_target_4xx_threshold_critical} EOQ monitor_thresholds { critical = var.httpcode_target_4xx_threshold_critical warning = var.httpcode_target_4xx_threshold_warning } evaluation_delay = var.evaluation_delay new_host_delay = var.new_host_delay notify_no_data = false renotify_interval = 0 require_full_window = false timeout_h = 0 include_tags = true tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_target_4xx_extra_tags) }