From 57abe436bf2901c84d848320df2fa283e2b82161 Mon Sep 17 00:00:00 2001 From: Alexandre Gaillet Date: Mon, 11 Jun 2018 11:37:49 +0200 Subject: [PATCH] MON-32 - module elasticache updated with variables in redis --- cloud/aws/elasticache/redis/README.md | 24 ++++ cloud/aws/elasticache/redis/inputs.tf | 135 ++++++++++++++++++ cloud/aws/elasticache/redis/monitors-redis.tf | 29 ++++ 3 files changed, 188 insertions(+) diff --git a/cloud/aws/elasticache/redis/README.md b/cloud/aws/elasticache/redis/README.md index f576872..2be14a9 100644 --- a/cloud/aws/elasticache/redis/README.md +++ b/cloud/aws/elasticache/redis/README.md @@ -56,9 +56,27 @@ Inputs | delay | Delay in seconds for the metric evaluation | string | `900` | no | | elasticache_size | Size of the Elasticache instance | string | - | yes | | environment | Infrastructure Environment | string | - | yes | +| 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 | | 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 | | nodes | Number of Elasticache nodes | string | - | yes | | 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 | @@ -66,6 +84,12 @@ Inputs | 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 percentage | string | `50000000` | no | +| swap_threshold_warning | Elasticache swap warning threshold in percentage | string | `0` | 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 | Related documentation --------------------- diff --git a/cloud/aws/elasticache/redis/inputs.tf b/cloud/aws/elasticache/redis/inputs.tf index 8a62621..940577b 100644 --- a/cloud/aws/elasticache/redis/inputs.tf +++ b/cloud/aws/elasticache/redis/inputs.tf @@ -145,3 +145,138 @@ variable "commands_timeframe" { description = "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`]" default = "last_5m" } + +# Elasticache specific +variable "eviction_silenced" { + description = "Groups to mute for Elasticache eviction monitor" + type = "map" + default = {} +} + +variable "eviction_message" { + description = "Custom message for Elasticache eviction monitor" + type = "string" + default = "" +} + +variable "eviction_time_aggregator" { + description = "Monitor aggregator for Elasticache eviction [available values: min, max or avg]" + type = "string" + default = "min" +} + +variable "eviction_timeframe" { + description = "Monitor timeframe for Elasticache eviction [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" + default = "last_5m" +} + +variable "max_connection_silenced" { + description = "Groups to mute for Elasticache max connection monitor" + type = "map" + default = {} +} + +variable "max_connection_message" { + description = "Custom message for Elasticache max connection monitor" + type = "string" + default = "" +} + +variable "max_connection_time_aggregator" { + description = "Monitor aggregator for Elasticache max connection [available values: min, max or avg]" + type = "string" + default = "max" +} + +variable "max_connection_timeframe" { + description = "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`]" + default = "last_5m" +} + +variable "no_connection_silenced" { + description = "Groups to mute for Elasticache no connection monitor" + type = "map" + default = {} +} + +variable "no_connection_message" { + description = "Custom message for Elasticache no connection monitor" + type = "string" + default = "" +} + +variable "no_connection_time_aggregator" { + description = "Monitor aggregator for Elasticache no connection [available values: min, max or avg]" + type = "string" + default = "min" +} + +variable "no_connection_timeframe" { + description = "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`]" + default = "last_5m" +} + +variable "swap_silenced" { + description = "Groups to mute for Elasticache swap monitor" + type = "map" + default = {} +} + +variable "swap_message" { + description = "Custom message for Elasticache swap monitor" + type = "string" + default = "" +} + +variable "swap_time_aggregator" { + description = "Monitor aggregator for Elasticache memcached swap [available values: min, max or avg]" + type = "string" + default = "min" +} + +variable "swap_timeframe" { + description = "Monitor timeframe for Elasticache swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`]" + default = "last_5m" +} + +variable "swap_threshold_warning" { + description = "Elasticache swap warning threshold in percentage" + default = 0 +} + +variable "swap_threshold_critical" { + description = "Elasticache swap critical threshold in percentage" + default = 50000000 +} + +variable "free_memory_silenced" { + description = "Groups to mute for Elasticache free memory monitor" + type = "map" + default = {} +} + +variable "free_memory_message" { + description = "Custom message for Elasticache free memory monitor" + type = "string" + default = "" +} + +variable "free_memory_condition_timeframe" { + description = "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`]" + default = "last_15m" +} + +variable "free_memory_timeframe" { + description = "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`]" + default = "last_15m" +} + +variable "free_memory_threshold_warning" { + description = "Elasticache free memory warning threshold in percentage" + default = -50 +} + +variable "free_memory_threshold_critical" { + description = "Elasticache free memory critical threshold in percentage" + default = -70 +} diff --git a/cloud/aws/elasticache/redis/monitors-redis.tf b/cloud/aws/elasticache/redis/monitors-redis.tf index b5c7935..6572a3f 100644 --- a/cloud/aws/elasticache/redis/monitors-redis.tf +++ b/cloud/aws/elasticache/redis/monitors-redis.tf @@ -13,6 +13,35 @@ module "datadog-monitors-aws-elasticache-common" { environment = "${var.environment}" filter_tags = "${data.template_file.filter.rendered}" resource = "redis" + + eviction_message = "${var.eviction_message}" + eviction_silenced = "${var.eviction_silenced}" + eviction_time_aggregator = "${var.eviction_time_aggregator}" + eviction_timeframe = "${var.eviction_timeframe}" + + free_memory_condition_timeframe = "${var.free_memory_condition_timeframe}" + free_memory_timeframe = "${var.free_memory_timeframe}" + free_memory_message = "${var.free_memory_message}" + free_memory_silenced = "${var.free_memory_silenced}" + free_memory_threshold_critical = "${var.free_memory_threshold_critical}" + free_memory_threshold_warning = "${var.free_memory_threshold_warning}" + + max_connection_message = "${var.max_connection_message}" + max_connection_silenced = "${var.max_connection_silenced}" + max_connection_time_aggregator = "${var.max_connection_time_aggregator}" + max_connection_timeframe = "${var.max_connection_timeframe}" + + no_connection_message = "${var.no_connection_message}" + no_connection_silenced = "${var.no_connection_silenced}" + no_connection_time_aggregator = "${var.no_connection_time_aggregator}" + no_connection_timeframe = "${var.no_connection_timeframe}" + + swap_message = "${var.swap_message}" + swap_silenced = "${var.swap_silenced}" + swap_threshold_critical = "${var.swap_threshold_critical}" + swap_threshold_warning = "${var.swap_threshold_warning}" + swap_time_aggregator = "${var.swap_time_aggregator}" + swap_timeframe = "${var.swap_timeframe}" } resource "datadog_monitor" "redis_cache_hits" {