resource "datadog_monitor" "elasticache_eviction" { name = "[${var.environment}] Elasticache eviction {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}" message = "${coalesce(var.eviction_message, var.message)}" type = "metric alert" query = < 0 EOF notify_no_data = false evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false new_host_delay = "${var.new_host_delay}" silenced = "${var.eviction_silenced}" tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] } resource "datadog_monitor" "elasticache_max_connection" { name = "[${var.environment}] Elasticache max connections reached {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" message = "${coalesce(var.max_connection_message, var.message)}" type = "metric alert" query = <= 65000 EOF notify_no_data = true evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false new_host_delay = "${var.new_host_delay}" silenced = "${var.max_connection_silenced}" tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] } resource "datadog_monitor" "elasticache_no_connection" { name = "[${var.environment}] Elasticache connections {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" message = "${coalesce(var.no_connection_message, var.message)}" type = "metric alert" query = < ${var.swap_threshold_critical} EOF thresholds { warning = "${var.swap_threshold_warning}" critical = "${var.swap_threshold_critical}" } notify_no_data = false evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false new_host_delay = "${var.new_host_delay}" silenced = "${var.swap_silenced}" tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] } # POC - A approfondir resource "datadog_monitor" "elasticache_free_memory" { name = "[${var.environment}] Elasticache free memory {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_memory_message, var.message)}" type = "metric alert" query = < ${var.eviction_growing_threshold_critical} EOF thresholds { warning = "${var.eviction_growing_threshold_warning}" critical = "${var.eviction_growing_threshold_critical}" } notify_no_data = false evaluation_delay = "${var.evaluation_delay}" renotify_interval = 0 notify_audit = false timeout_h = 0 include_tags = true locked = false require_full_window = false new_host_delay = "${var.new_host_delay}" silenced = "${var.eviction_growing_silenced}" tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] }