diff --git a/cloud/aws/elasticache/common/inputs.tf b/cloud/aws/elasticache/common/inputs.tf index 6a686b2..078ded3 100644 --- a/cloud/aws/elasticache/common/inputs.tf +++ b/cloud/aws/elasticache/common/inputs.tf @@ -17,10 +17,6 @@ variable "filter_tags" { description = "Tags used for filtering" } -variable "resource" { - description = "Type of Elasticache used" -} - # Elasticache specific variable "eviction_silenced" { description = "Groups to mute for Elasticache eviction monitor" diff --git a/cloud/aws/elasticache/common/monitors-elasticache.tf b/cloud/aws/elasticache/common/monitors-elasticache.tf index 6d53ade..fb33362 100644 --- a/cloud/aws/elasticache/common/monitors-elasticache.tf +++ b/cloud/aws/elasticache/common/monitors-elasticache.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "elasticache_eviction" { - name = "[${var.environment}] Elasticache ${var.resource} eviction {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}" + name = "[${var.environment}] Elasticache eviction {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}" message = "${coalesce(var.eviction_message, var.message)}" type = "metric alert" @@ -26,7 +26,7 @@ resource "datadog_monitor" "elasticache_eviction" { } resource "datadog_monitor" "elasticache_max_connection" { - name = "[${var.environment}] Elasticache ${var.resource} max connections reached {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" + name = "[${var.environment}] Elasticache max connections reached {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" message = "${coalesce(var.max_connection_message, var.message)}" type = "metric alert" @@ -53,7 +53,7 @@ resource "datadog_monitor" "elasticache_max_connection" { } resource "datadog_monitor" "elasticache_no_connection" { - name = "[${var.environment}] Elasticache ${var.resource} connections {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" + name = "[${var.environment}] Elasticache connections {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" message = "${coalesce(var.no_connection_message, var.message)}" type = "metric alert" @@ -80,7 +80,7 @@ resource "datadog_monitor" "elasticache_no_connection" { } resource "datadog_monitor" "elasticache_swap" { - name = "[${var.environment}] Elasticache ${var.resource} swap {{#is_alert}}{{{comparator}}} {{threshold}}MB ({{value}}MB){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}MB ({{value}}MB){{/is_warning}}" + name = "[${var.environment}] Elasticache swap {{#is_alert}}{{{comparator}}} {{threshold}}MB ({{value}}MB){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}MB ({{value}}MB){{/is_warning}}" message = "${coalesce(var.swap_message, var.message)}" type = "metric alert" @@ -113,7 +113,7 @@ resource "datadog_monitor" "elasticache_swap" { # POC - A approfondir resource "datadog_monitor" "elasticache_free_memory" { - name = "[${var.environment}] Elasticache ${var.resource} free memory {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + 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" @@ -145,7 +145,7 @@ resource "datadog_monitor" "elasticache_free_memory" { } resource "datadog_monitor" "elasticache_eviction_growing" { - name = "[${var.environment}] Elasticache ${var.resource} evictions is growing {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" + name = "[${var.environment}] Elasticache evictions is growing {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.eviction_growing_message, var.message)}" type = "metric alert"