diff --git a/cloud/aws/elasticache/common/README.md b/cloud/aws/elasticache/common/README.md index f9d2d6e..6d9263c 100644 --- a/cloud/aws/elasticache/common/README.md +++ b/cloud/aws/elasticache/common/README.md @@ -16,20 +16,24 @@ module "datadog-monitors-cloud-aws-elasticache-common" { Creates DataDog monitors with the following checks: -- Elasticache ${var.resource} eviction -- Elasticache ${var.resource} max connections reached -- Elasticache ${var.resource} connections -- Elasticache ${var.resource} swap -- Elasticache ${var.resource} free memory -- Elasticache ${var.resource} evictions is growing +- Elasticache connections +- Elasticache eviction +- Elasticache evictions is growing +- Elasticache free memory +- Elasticache max connections reached +- Elasticache swap ## Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| delay | Delay in seconds for the metric evaluation | string | - | yes | | environment | Infrastructure Environment | string | - | yes | +| evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| eviction_enabled | Flag to enable Elasticache eviction monitor | string | `true` | no | +| eviction_extra_tags | Extra tags for Elasticache eviction monitor | list | `` | no | | eviction_growing_condition_timeframe | Monitor condition timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | - | yes | +| eviction_growing_enabled | Flag to enable Elasticache eviction growing monitor | string | `true` | no | +| eviction_growing_extra_tags | Extra tags for Elasticache eviction growing monitor | list | `` | no | | eviction_growing_message | Custom message for Elasticache eviction growing monitor | string | - | yes | | eviction_growing_silenced | Groups to mute for Elasticache eviction growing monitor | map | - | yes | | eviction_growing_threshold_critical | Elasticache eviction growing critical threshold in percentage | string | - | yes | @@ -39,23 +43,32 @@ Creates DataDog monitors with the following checks: | eviction_silenced | Groups to mute for Elasticache eviction monitor | map | - | yes | | eviction_time_aggregator | Monitor aggregator for Elasticache eviction [available values: min, max or avg] | string | - | yes | | eviction_timeframe | Monitor timeframe for Elasticache eviction [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | - | yes | -| filter_tags | Tags used for filtering | string | - | yes | +| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | +| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | | free_memory_condition_timeframe | Monitor condition timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | - | yes | +| free_memory_enabled | Flag to enable Elasticache free memory monitor | string | `true` | no | +| free_memory_extra_tags | Extra tags for Elasticache free memory monitor | list | `` | no | | free_memory_message | Custom message for Elasticache free memory monitor | string | - | yes | | free_memory_silenced | Groups to mute for Elasticache free memory monitor | map | - | yes | | free_memory_threshold_critical | Elasticache free memory critical threshold in percentage | string | - | yes | | free_memory_threshold_warning | Elasticache free memory warning threshold in percentage | string | - | yes | | free_memory_timeframe | Monitor timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | - | yes | +| max_connection_enabled | Flag to enable Elasticache max connection monitor | string | `true` | no | +| max_connection_extra_tags | Extra tags for Elasticache max connection monitor | list | `` | no | | max_connection_message | Custom message for Elasticache max connection monitor | string | - | yes | | max_connection_silenced | Groups to mute for Elasticache max connection monitor | map | - | yes | | max_connection_time_aggregator | Monitor aggregator for Elasticache max connection [available values: min, max or avg] | string | - | yes | | max_connection_timeframe | Monitor timeframe for Elasticache max connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | - | yes | | message | Message sent when an alert is triggered | string | - | yes | +| new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| no_connection_enabled | Flag to enable Elasticache no connection monitor | string | `true` | no | +| no_connection_extra_tags | Extra tags for Elasticache no connection monitor | list | `` | no | | no_connection_message | Custom message for Elasticache no connection monitor | string | - | yes | | no_connection_silenced | Groups to mute for Elasticache no connection monitor | map | - | yes | | no_connection_time_aggregator | Monitor aggregator for Elasticache no connection [available values: min, max or avg] | string | - | yes | | no_connection_timeframe | Monitor timeframe for Elasticache no connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | - | yes | -| resource | Type of Elasticache used | string | - | yes | +| swap_enabled | Flag to enable Elasticache swap monitor | string | `true` | no | +| swap_extra_tags | Extra tags for Elasticache swap monitor | list | `` | no | | swap_message | Custom message for Elasticache swap monitor | string | - | yes | | swap_silenced | Groups to mute for Elasticache swap monitor | map | - | yes | | swap_threshold_critical | Elasticache swap critical threshold in percentage | string | - | yes | diff --git a/cloud/aws/elasticache/common/inputs.tf b/cloud/aws/elasticache/common/inputs.tf index 12354d7..1a35318 100644 --- a/cloud/aws/elasticache/common/inputs.tf +++ b/cloud/aws/elasticache/common/inputs.tf @@ -40,6 +40,7 @@ variable "eviction_enabled" { type = "string" default = "true" } + variable "eviction_extra_tags" { description = "Extra tags for Elasticache eviction monitor" type = "list" @@ -70,6 +71,7 @@ variable "max_connection_enabled" { type = "string" default = "true" } + variable "max_connection_extra_tags" { description = "Extra tags for Elasticache max connection monitor" type = "list" @@ -100,6 +102,7 @@ variable "no_connection_enabled" { type = "string" default = "true" } + variable "no_connection_extra_tags" { description = "Extra tags for Elasticache no connection monitor" type = "list" @@ -130,6 +133,7 @@ variable "swap_enabled" { type = "string" default = "true" } + variable "swap_extra_tags" { description = "Extra tags for Elasticache swap monitor" type = "list" @@ -168,6 +172,7 @@ variable "free_memory_enabled" { type = "string" default = "true" } + variable "free_memory_extra_tags" { description = "Extra tags for Elasticache free memory monitor" type = "list" @@ -205,6 +210,7 @@ variable "eviction_growing_enabled" { type = "string" default = "true" } + variable "eviction_growing_extra_tags" { description = "Extra tags for Elasticache eviction growing monitor" type = "list" diff --git a/cloud/aws/elasticache/common/monitors-elasticache.tf b/cloud/aws/elasticache/common/monitors-elasticache.tf index f0191b8..d2b635d 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" { -count = "${var.eviction_enabled ? 1 : 0}" + count = "${var.eviction_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache eviction {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}" message = "${coalesce(var.eviction_message, var.message)}" @@ -27,7 +27,7 @@ count = "${var.eviction_enabled ? 1 : 0}" } resource "datadog_monitor" "elasticache_max_connection" { -count = "${var.max_connection_enabled ? 1 : 0}" + count = "${var.max_connection_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache max connections reached {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" message = "${coalesce(var.max_connection_message, var.message)}" @@ -55,7 +55,7 @@ count = "${var.max_connection_enabled ? 1 : 0}" } resource "datadog_monitor" "elasticache_no_connection" { -count = "${var.no_connection_enabled ? 1 : 0}" + count = "${var.no_connection_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache connections {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" message = "${coalesce(var.no_connection_message, var.message)}" @@ -83,7 +83,7 @@ count = "${var.no_connection_enabled ? 1 : 0}" } resource "datadog_monitor" "elasticache_swap" { -count = "${var.swap_enabled ? 1 : 0}" + count = "${var.swap_enabled ? 1 : 0}" 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)}" @@ -117,7 +117,7 @@ count = "${var.swap_enabled ? 1 : 0}" # POC - A approfondir resource "datadog_monitor" "elasticache_free_memory" { -count = "${var.free_memory_enabled ? 1 : 0}" + count = "${var.free_memory_enabled ? 1 : 0}" 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)}" @@ -150,7 +150,7 @@ count = "${var.free_memory_enabled ? 1 : 0}" } resource "datadog_monitor" "elasticache_eviction_growing" { -count = "${var.eviction_growing_enabled ? 1 : 0}" + count = "${var.eviction_growing_enabled ? 1 : 0}" 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)}" diff --git a/cloud/aws/elasticache/common/outputs.tf b/cloud/aws/elasticache/common/outputs.tf index a1e295e..5268c4d 100644 --- a/cloud/aws/elasticache/common/outputs.tf +++ b/cloud/aws/elasticache/common/outputs.tf @@ -1,29 +1,29 @@ output "elasticache_eviction_id" { description = "id for monitor elasticache_eviction" - value = "${datadog_monitor.elasticache_eviction.id}" + value = "${datadog_monitor.elasticache_eviction.*.id}" } output "elasticache_max_connection_id" { description = "id for monitor elasticache_max_connection" - value = "${datadog_monitor.elasticache_max_connection.id}" + value = "${datadog_monitor.elasticache_max_connection.*.id}" } output "elasticache_no_connection_id" { description = "id for monitor elasticache_no_connection" - value = "${datadog_monitor.elasticache_no_connection.id}" + value = "${datadog_monitor.elasticache_no_connection.*.id}" } output "elasticache_swap_id" { description = "id for monitor elasticache_swap" - value = "${datadog_monitor.elasticache_swap.id}" + value = "${datadog_monitor.elasticache_swap.*.id}" } output "elasticache_free_memory_id" { description = "id for monitor elasticache_free_memory" - value = "${datadog_monitor.elasticache_free_memory.id}" + value = "${datadog_monitor.elasticache_free_memory.*.id}" } output "elasticache_eviction_growing_id" { description = "id for monitor elasticache_eviction_growing" - value = "${datadog_monitor.elasticache_eviction_growing.id}" + value = "${datadog_monitor.elasticache_eviction_growing.*.id}" } diff --git a/cloud/aws/elasticache/memcached/README.md b/cloud/aws/elasticache/memcached/README.md index 2ec298e..b697225 100644 --- a/cloud/aws/elasticache/memcached/README.md +++ b/cloud/aws/elasticache/memcached/README.md @@ -16,59 +16,34 @@ module "datadog-monitors-cloud-aws-elasticache-memcached" { Creates DataDog monitors with the following checks: -- Elasticache memcached get hits - Elasticache memcached CPU +- Elasticache memcached get hits ## Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| cpu_high_enabled | Flag to enable Elasticache memcached cpu high monitor | string | `true` | no | +| cpu_high_extra_tags | Extra tags for Elasticache memcached cpu high monitor | list | `` | no | | cpu_high_message | Custom message for Elasticache memcached cpu high monitor | string | `` | no | | cpu_high_silenced | Groups to mute for Elasticache memcached cpu high monitor | map | `` | no | | cpu_high_threshold_critical | Elasticache memcached cpu high critical threshold in percentage | string | `90` | no | | cpu_high_threshold_warning | Elasticache memcached cpu high warning threshold in percentage | string | `75` | no | | cpu_high_time_aggregator | Monitor aggregator for Elasticache memcached cpu high [available values: min, max or avg] | string | `min` | no | | cpu_high_timeframe | Monitor timeframe for Elasticache memcached cpu high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | -| delay | Delay in seconds for the metric evaluation | string | `900` | no | | environment | Infrastructure Environment | string | - | yes | -| eviction_growing_condition_timeframe | Monitor condition timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | -| eviction_growing_message | Custom message for Elasticache eviction growing monitor | string | `` | no | -| eviction_growing_silenced | Groups to mute for Elasticache eviction growing monitor | map | `` | no | -| eviction_growing_threshold_critical | Elasticache eviction growing critical threshold in percentage | string | `30` | no | -| eviction_growing_threshold_warning | Elasticache eviction growing warning threshold in percentage | string | `10` | no | -| eviction_growing_timeframe | Monitor timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | -| eviction_message | Custom message for Elasticache eviction monitor | string | `` | no | -| eviction_silenced | Groups to mute for Elasticache eviction monitor | map | `` | no | -| eviction_time_aggregator | Monitor aggregator for Elasticache eviction [available values: min, max or avg] | string | `min` | no | -| eviction_timeframe | Monitor timeframe for Elasticache eviction [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | -| free_memory_condition_timeframe | Monitor condition timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | -| free_memory_message | Custom message for Elasticache free memory monitor | string | `` | no | -| free_memory_silenced | Groups to mute for Elasticache free memory monitor | map | `` | no | -| free_memory_threshold_critical | Elasticache free memory critical threshold in percentage | string | `-70` | no | -| free_memory_threshold_warning | Elasticache free memory warning threshold in percentage | string | `-50` | no | -| free_memory_timeframe | Monitor timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | +| get_hits_enabled | Flag to enable Elasticache memcached get hits monitor | string | `true` | no | +| get_hits_extra_tags | Extra tags for Elasticache memcached get hits monitor | list | `` | no | | get_hits_message | Custom message for Elasticache memcached get hits monitor | string | `` | no | | get_hits_silenced | Groups to mute for Elasticache memcached get hits monitor | map | `` | no | | get_hits_threshold_critical | Elasticache memcached get hits critical threshold in percentage | string | `10` | no | | get_hits_threshold_warning | Elasticache memcached get hits warning threshold in percentage | string | `20` | no | | get_hits_timeframe | Monitor timeframe for Elasticache memcached get hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | -| max_connection_message | Custom message for Elasticache max connection monitor | string | `` | no | -| max_connection_silenced | Groups to mute for Elasticache max connection monitor | map | `` | no | -| max_connection_time_aggregator | Monitor aggregator for Elasticache max connection [available values: min, max or avg] | string | `max` | no | -| max_connection_timeframe | Monitor timeframe for Elasticache max connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | message | Message sent when an alert is triggered | string | - | yes | -| no_connection_message | Custom message for Elasticache no connection monitor | string | `` | no | -| no_connection_silenced | Groups to mute for Elasticache no connection monitor | map | `` | no | -| no_connection_time_aggregator | Monitor aggregator for Elasticache no connection [available values: min, max or avg] | string | `min` | no | -| no_connection_timeframe | Monitor timeframe for Elasticache no connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | -| swap_message | Custom message for Elasticache swap monitor | string | `` | no | -| swap_silenced | Groups to mute for Elasticache swap monitor | map | `` | no | -| swap_threshold_critical | Elasticache swap critical threshold in Bytes | string | `50000000` | no | -| swap_threshold_warning | Elasticache swap warning threshold in Bytes | string | `40000000` | no | -| swap_time_aggregator | Monitor aggregator for Elasticache memcached swap [available values: min, max or avg] | string | `min` | no | -| swap_timeframe | Monitor timeframe for Elasticache swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | ## Outputs diff --git a/cloud/aws/elasticache/memcached/inputs.tf b/cloud/aws/elasticache/memcached/inputs.tf index 3c0868f..fd8330c 100644 --- a/cloud/aws/elasticache/memcached/inputs.tf +++ b/cloud/aws/elasticache/memcached/inputs.tf @@ -35,6 +35,7 @@ variable "get_hits_silenced" { type = "map" default = {} } + variable "get_hits_enabled" { description = "Flag to enable Elasticache memcached get hits monitor" type = "string" @@ -73,6 +74,7 @@ variable "cpu_high_silenced" { type = "map" default = {} } + variable "cpu_high_enabled" { description = "Flag to enable Elasticache memcached cpu high monitor" type = "string" diff --git a/cloud/aws/elasticache/memcached/monitors-memcached.tf b/cloud/aws/elasticache/memcached/monitors-memcached.tf index 29382bb..b9cb556 100644 --- a/cloud/aws/elasticache/memcached/monitors-memcached.tf +++ b/cloud/aws/elasticache/memcached/monitors-memcached.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "memcached_get_hits" { -count = "${var.get_hits_enabled ? 1 : 0}" + count = "${var.get_hits_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache memcached get hits {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.get_hits_message, var.message)}" @@ -34,7 +34,7 @@ count = "${var.get_hits_enabled ? 1 : 0}" } resource "datadog_monitor" "memcached_cpu_high" { -count = "${var.cpu_high_enabled ? 1 : 0}" + count = "${var.cpu_high_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache memcached CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_high_message, var.message)}" diff --git a/cloud/aws/elasticache/memcached/outputs.tf b/cloud/aws/elasticache/memcached/outputs.tf index d4ed36e..7beb0d5 100644 --- a/cloud/aws/elasticache/memcached/outputs.tf +++ b/cloud/aws/elasticache/memcached/outputs.tf @@ -1,9 +1,9 @@ output "memcached_get_hits_id" { description = "id for monitor memcached_get_hits" - value = "${datadog_monitor.memcached_get_hits.id}" + value = "${datadog_monitor.memcached_get_hits.*.id}" } output "memcached_cpu_high_id" { description = "id for monitor memcached_cpu_high" - value = "${datadog_monitor.memcached_cpu_high.id}" + value = "${datadog_monitor.memcached_cpu_high.*.id}" } diff --git a/cloud/aws/elasticache/redis/README.md b/cloud/aws/elasticache/redis/README.md index 0e3a5cc..77c13d1 100644 --- a/cloud/aws/elasticache/redis/README.md +++ b/cloud/aws/elasticache/redis/README.md @@ -18,68 +18,47 @@ Creates DataDog monitors with the following checks: - Elasticache redis cache hits - Elasticache redis CPU -- Elasticache redis replication lag - Elasticache redis is receiving no commands +- Elasticache redis replication lag ## Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| cache_hits_enabled | Flag to enable Elasticache redis cache hits monitor | string | `true` | no | +| cache_hits_extra_tags | Extra tags for Elasticache redis cache hits monitor | list | `` | no | | cache_hits_message | Custom message for Elasticache redis cache hits monitor | string | `` | no | | cache_hits_silenced | Groups to mute for Elasticache redis cache hits monitor | map | `` | no | | cache_hits_threshold_critical | Elasticache redis cache hits critical threshold in percentage | string | `10` | no | | cache_hits_threshold_warning | Elasticache redis cache hits warning threshold in percentage | string | `20` | no | | cache_hits_timeframe | Monitor timeframe for Elasticache redis cache hits [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | +| commands_enabled | Flag to enable Elasticache redis commands monitor | string | `true` | no | +| commands_extra_tags | Extra tags for Elasticache redis commands monitor | list | `` | no | | commands_message | Custom message for Elasticache redis commands monitor | string | `` | no | | commands_silenced | Groups to mute for Elasticache redis commands monitor | map | `` | no | | commands_timeframe | Monitor timeframe for Elasticache redis commands [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| cpu_high_enabled | Flag to enable Elasticache redis cpu high monitor | string | `true` | no | +| cpu_high_extra_tags | Extra tags for Elasticache redis cpu high monitor | list | `` | no | | cpu_high_message | Custom message for Elasticache redis cpu high monitor | string | `` | no | | cpu_high_silenced | Groups to mute for Elasticache redis cpu high monitor | map | `` | no | | cpu_high_threshold_critical | Elasticache redis cpu high critical threshold in percentage | string | `90` | no | | cpu_high_threshold_warning | Elasticache redis cpu high warning threshold in percentage | string | `75` | no | | cpu_high_time_aggregator | Monitor aggregator for Elasticache redis cpu high [available values: min, max or avg] | string | `avg` | no | | cpu_high_timeframe | Monitor timeframe for Elasticache redis cpu high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | -| delay | Delay in seconds for the metric evaluation | string | `900` | no | | environment | Infrastructure Environment | string | - | yes | -| eviction_growing_condition_timeframe | Monitor condition timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | -| eviction_growing_message | Custom message for Elasticache eviction growing monitor | string | `` | no | -| eviction_growing_silenced | Groups to mute for Elasticache eviction growing monitor | map | `` | no | -| eviction_growing_threshold_critical | Elasticache eviction growing critical threshold in percentage | string | `30` | no | -| eviction_growing_threshold_warning | Elasticache eviction growing warning threshold in percentage | string | `10` | no | -| eviction_growing_timeframe | Monitor timeframe for Elasticache eviction growing [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | -| eviction_message | Custom message for Elasticache eviction monitor | string | `` | no | -| eviction_silenced | Groups to mute for Elasticache eviction monitor | map | `` | no | -| eviction_time_aggregator | Monitor aggregator for Elasticache eviction [available values: min, max or avg] | string | `min` | no | -| eviction_timeframe | Monitor timeframe for Elasticache eviction [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | | filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | | filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | -| free_memory_condition_timeframe | Monitor condition timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | -| free_memory_message | Custom message for Elasticache free memory monitor | string | `` | no | -| free_memory_silenced | Groups to mute for Elasticache free memory monitor | map | `` | no | -| free_memory_threshold_critical | Elasticache free memory critical threshold in percentage | string | `-70` | no | -| free_memory_threshold_warning | Elasticache free memory warning threshold in percentage | string | `-50` | no | -| free_memory_timeframe | Monitor timeframe for Elasticache free memory [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_15m` | no | -| max_connection_message | Custom message for Elasticache max connection monitor | string | `` | no | -| max_connection_silenced | Groups to mute for Elasticache max connection monitor | map | `` | no | -| max_connection_time_aggregator | Monitor aggregator for Elasticache max connection [available values: min, max or avg] | string | `max` | no | -| max_connection_timeframe | Monitor timeframe for Elasticache max connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | | message | Message sent when an alert is triggered | string | - | yes | -| no_connection_message | Custom message for Elasticache no connection monitor | string | `` | no | -| no_connection_silenced | Groups to mute for Elasticache no connection monitor | map | `` | no | -| no_connection_time_aggregator | Monitor aggregator for Elasticache no connection [available values: min, max or avg] | string | `min` | no | -| no_connection_timeframe | Monitor timeframe for Elasticache no connection [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| replication_lag_enabled | Flag to enable Elasticache redis replication lag monitor | string | `true` | no | +| replication_lag_extra_tags | Extra tags for Elasticache redis replication lag monitor | list | `` | no | | replication_lag_message | Custom message for Elasticache redis replication lag monitor | string | `` | no | | replication_lag_silenced | Groups to mute for Elasticache redis replication lag monitor | map | `` | no | | replication_lag_threshold_critical | Elasticache redis replication lag critical threshold in seconds | string | `1` | no | | replication_lag_threshold_warning | Elasticache redis replication lag warning threshold in seconds | string | `0` | no | | replication_lag_time_aggregator | Monitor aggregator for Elasticache redis replication lag [available values: min, max or avg] | string | `min` | no | | replication_lag_timeframe | Monitor timeframe for Elasticache redis replication lag [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | -| swap_message | Custom message for Elasticache swap monitor | string | `` | no | -| swap_silenced | Groups to mute for Elasticache swap monitor | map | `` | no | -| swap_threshold_critical | Elasticache swap critical threshold in Bytes | string | `50000000` | no | -| swap_threshold_warning | Elasticache swap warning threshold in Bytes | string | `40000000` | no | -| swap_time_aggregator | Monitor aggregator for Elasticache memcached swap [available values: min, max or avg] | string | `min` | no | -| swap_timeframe | Monitor timeframe for Elasticache swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | ## Outputs diff --git a/cloud/aws/elasticache/redis/inputs.tf b/cloud/aws/elasticache/redis/inputs.tf index 185f960..4573abf 100644 --- a/cloud/aws/elasticache/redis/inputs.tf +++ b/cloud/aws/elasticache/redis/inputs.tf @@ -35,6 +35,7 @@ variable "cache_hits_silenced" { type = "map" default = {} } + variable "cache_hits_enabled" { description = "Flag to enable Elasticache redis cache hits monitor" type = "string" @@ -73,6 +74,7 @@ variable "cpu_high_silenced" { type = "map" default = {} } + variable "cpu_high_enabled" { description = "Flag to enable Elasticache redis cpu high monitor" type = "string" @@ -117,6 +119,7 @@ variable "replication_lag_silenced" { type = "map" default = {} } + variable "replication_lag_enabled" { description = "Flag to enable Elasticache redis replication lag monitor" type = "string" @@ -161,6 +164,7 @@ variable "commands_silenced" { type = "map" default = {} } + variable "commands_enabled" { description = "Flag to enable Elasticache redis commands monitor" type = "string" diff --git a/cloud/aws/elasticache/redis/monitors-redis.tf b/cloud/aws/elasticache/redis/monitors-redis.tf index 08d67d5..04e89fc 100644 --- a/cloud/aws/elasticache/redis/monitors-redis.tf +++ b/cloud/aws/elasticache/redis/monitors-redis.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "redis_cache_hits" { -count = "${var.cache_hits_enabled ? 1 : 0}" + count = "${var.cache_hits_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache redis cache hits {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cache_hits_message, var.message)}" @@ -34,7 +34,7 @@ count = "${var.cache_hits_enabled ? 1 : 0}" } resource "datadog_monitor" "redis_cpu_high" { -count = "${var.cpu_high_enabled ? 1 : 0}" + count = "${var.cpu_high_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache redis CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_high_message, var.message)}" @@ -62,7 +62,7 @@ count = "${var.cpu_high_enabled ? 1 : 0}" } resource "datadog_monitor" "redis_replication_lag" { -count = "${var.replication_lag_enabled ? 1 : 0}" + count = "${var.replication_lag_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache redis replication lag {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = "${coalesce(var.replication_lag_message, var.message)}" @@ -95,7 +95,7 @@ count = "${var.replication_lag_enabled ? 1 : 0}" } resource "datadog_monitor" "redis_commands" { -count = "${var.commands_enabled ? 1 : 0}" + count = "${var.commands_enabled ? 1 : 0}" name = "[${var.environment}] Elasticache redis is receiving no commands" message = "${coalesce(var.commands_message, var.message)}" diff --git a/cloud/aws/elasticache/redis/outputs.tf b/cloud/aws/elasticache/redis/outputs.tf index 23bbe75..77bbcfa 100644 --- a/cloud/aws/elasticache/redis/outputs.tf +++ b/cloud/aws/elasticache/redis/outputs.tf @@ -1,19 +1,19 @@ output "redis_cache_hits_id" { description = "id for monitor redis_cache_hits" - value = "${datadog_monitor.redis_cache_hits.id}" + value = "${datadog_monitor.redis_cache_hits.*.id}" } output "redis_cpu_high_id" { description = "id for monitor redis_cpu_high" - value = "${datadog_monitor.redis_cpu_high.id}" + value = "${datadog_monitor.redis_cpu_high.*.id}" } output "redis_replication_lag_id" { description = "id for monitor redis_replication_lag" - value = "${datadog_monitor.redis_replication_lag.id}" + value = "${datadog_monitor.redis_replication_lag.*.id}" } output "redis_commands_id" { description = "id for monitor redis_commands" - value = "${datadog_monitor.redis_commands.id}" + value = "${datadog_monitor.redis_commands.*.id}" }