From 9f97ace37ec923f9e127f7f7384c81f5b0cebe36 Mon Sep 17 00:00:00 2001 From: Jordan Caussat Date: Mon, 21 Oct 2019 14:28:55 +0200 Subject: [PATCH] MON-517: Add variable to configure LB warning threshold --- cloud/aws/alb/README.md | 1 + cloud/aws/alb/inputs.tf | 5 +++++ cloud/aws/alb/monitors-alb.tf | 2 +- cloud/aws/elb/README.md | 1 + cloud/aws/elb/inputs.tf | 5 +++++ cloud/aws/elb/monitors-elb.tf | 2 +- cloud/aws/nlb/README.md | 1 + cloud/aws/nlb/inputs.tf | 4 ++++ cloud/aws/nlb/monitors-nlb.tf | 2 +- 9 files changed, 20 insertions(+), 3 deletions(-) diff --git a/cloud/aws/alb/README.md b/cloud/aws/alb/README.md index c5428f7..de1f302 100644 --- a/cloud/aws/alb/README.md +++ b/cloud/aws/alb/README.md @@ -30,6 +30,7 @@ Creates DataDog monitors with the following checks: | alb\_no\_healthy\_instances\_enabled | Flag to enable ALB no healthy instances monitor | string | `"true"` | no | | alb\_no\_healthy\_instances\_extra\_tags | Extra tags for ALB no healthy instances monitor | list(string) | `[]` | no | | alb\_no\_healthy\_instances\_message | Custom message for ALB no healthy instances monitor | string | `""` | no | +| alb\_no\_healthy\_instances\_threshold\_warning | ALB no healthy instances warning threshold in percentage | string | `"100"` | no | | alb\_no\_healthy\_instances\_time\_aggregator | Monitor aggregator for ALB no healthy instances [available values: min, max or avg] | string | `"min"` | no | | alb\_no\_healthy\_instances\_timeframe | Monitor timeframe for ALB no healthy instances [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | artificial\_requests\_count | Number of false requests used to mitigate false positive in case of low trafic | string | `"5"` | no | diff --git a/cloud/aws/alb/inputs.tf b/cloud/aws/alb/inputs.tf index 0c1c101..1de1f12 100644 --- a/cloud/aws/alb/inputs.tf +++ b/cloud/aws/alb/inputs.tf @@ -71,6 +71,11 @@ variable "alb_no_healthy_instances_timeframe" { default = "last_5m" } +variable "alb_no_healthy_instances_threshold_warning" { + description = "ALB no healthy instances warning threshold in percentage" + default = 100 +} + variable "latency_enabled" { description = "Flag to enable ALB latency monitor" type = string diff --git a/cloud/aws/alb/monitors-alb.tf b/cloud/aws/alb/monitors-alb.tf index 4a2de92..0fe3af4 100644 --- a/cloud/aws/alb/monitors-alb.tf +++ b/cloud/aws/alb/monitors-alb.tf @@ -14,7 +14,7 @@ EOQ thresholds = { critical = 1 - warning = 100 + warning = var.alb_no_healthy_instances_threshold_warning } evaluation_delay = var.evaluation_delay diff --git a/cloud/aws/elb/README.md b/cloud/aws/elb/README.md index ad8cf76..b946250 100644 --- a/cloud/aws/elb/README.md +++ b/cloud/aws/elb/README.md @@ -62,6 +62,7 @@ Creates DataDog monitors with the following checks: | elb\_no\_healthy\_instance\_enabled | Flag to enable ELB no healty instance monitor | string | `"true"` | no | | elb\_no\_healthy\_instance\_extra\_tags | Extra tags for ELB no healty instance monitor | list(string) | `[]` | no | | elb\_no\_healthy\_instance\_message | Custom message for ELB no healty instance monitor | string | `""` | no | +| elb\_no\_healthy\_instance\_threshold\_warning | ELB no healthy instances warning threshold in percentage | string | `"100"` | no | | elb\_no\_healthy\_instance\_time\_aggregator | Monitor aggregator for ELB no healty instance [available values: min or max] | string | `"min"` | no | | elb\_no\_healthy\_instance\_timeframe | Monitor timeframe for ELB no healty instance [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | environment | Architecture Environment | string | n/a | yes | diff --git a/cloud/aws/elb/inputs.tf b/cloud/aws/elb/inputs.tf index eaf78fb..91efc47 100644 --- a/cloud/aws/elb/inputs.tf +++ b/cloud/aws/elb/inputs.tf @@ -71,6 +71,11 @@ variable "elb_no_healthy_instance_timeframe" { default = "last_5m" } +variable "elb_no_healthy_instance_threshold_warning" { + description = "ELB no healthy instances warning threshold in percentage" + default = 100 +} + variable "elb_4xx_enabled" { description = "Flag to enable ELB 4xx errors monitor" type = string diff --git a/cloud/aws/elb/monitors-elb.tf b/cloud/aws/elb/monitors-elb.tf index 825fd01..3175ada 100644 --- a/cloud/aws/elb/monitors-elb.tf +++ b/cloud/aws/elb/monitors-elb.tf @@ -14,7 +14,7 @@ EOQ thresholds = { critical = 1 - warning = 100 + warning = var.elb_no_healthy_instance_threshold_warning } evaluation_delay = var.evaluation_delay diff --git a/cloud/aws/nlb/README.md b/cloud/aws/nlb/README.md index 0587bcc..e0299cb 100644 --- a/cloud/aws/nlb/README.md +++ b/cloud/aws/nlb/README.md @@ -32,6 +32,7 @@ Creates DataDog monitors with the following checks: | nlb\_no\_healthy\_instances\_enabled | Flag to enable NLB no healthy instances monitor | string | `"true"` | no | | nlb\_no\_healthy\_instances\_extra\_tags | Extra tags for NLB no healthy instances monitor | list(string) | `[]` | no | | nlb\_no\_healthy\_instances\_message | Custom message for NLB no healthy instances monitor | string | `""` | no | +| nlb\_no\_healthy\_instances\_threshold\_warning | NLB no healthy instances warning threshold in percentage | string | `"100"` | no | | nlb\_no\_healthy\_instances\_time\_aggregator | Monitor aggregator for NLB no healthy instances [available values: min, max or avg] | string | `"min"` | no | | nlb\_no\_healthy\_instances\_timeframe | Monitor timeframe for NLB no healthy instances [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `"last_5m"` | no | | prefix\_slug | Prefix string to prepend between brackets on every monitors names | string | `""` | no | diff --git a/cloud/aws/nlb/inputs.tf b/cloud/aws/nlb/inputs.tf index 92ae8cc..03a4566 100644 --- a/cloud/aws/nlb/inputs.tf +++ b/cloud/aws/nlb/inputs.tf @@ -71,3 +71,7 @@ variable "nlb_no_healthy_instances_timeframe" { default = "last_5m" } +variable "nlb_no_healthy_instances_threshold_warning" { + description = "NLB no healthy instances warning threshold in percentage" + default = 100 +} diff --git a/cloud/aws/nlb/monitors-nlb.tf b/cloud/aws/nlb/monitors-nlb.tf index 3490c27..721de62 100644 --- a/cloud/aws/nlb/monitors-nlb.tf +++ b/cloud/aws/nlb/monitors-nlb.tf @@ -14,7 +14,7 @@ EOQ thresholds = { critical = 1 - warning = 100 + warning = var.nlb_no_healthy_instances_threshold_warning } evaluation_delay = var.evaluation_delay