diff --git a/README.md b/README.md index 3be9395..4efcd0c 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,8 @@ The `//` is very important, it's a terraform specific syntax used to separate gi ### Monitors summary ### - [caas](https://bitbucket.org/morea/terraform.feature.datadog/src/master/caas/) - - [k8s](https://bitbucket.org/morea/terraform.feature.datadog/src/master/caas/k8s/) - - [ingress](https://bitbucket.org/morea/terraform.feature.datadog/src/master/caas/k8s/ingress/) + - [kubernetes](https://bitbucket.org/morea/terraform.feature.datadog/src/master/caas/kubernetes/) + - [ingress](https://bitbucket.org/morea/terraform.feature.datadog/src/master/caas/kubernetes/ingress/) - [cloud](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/) - [aws](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/aws/) - [alb](https://bitbucket.org/morea/terraform.feature.datadog/src/master/cloud/aws/alb/) diff --git a/caas/k8s/ingress/README.md b/caas/kubernetes/ingress/README.md similarity index 91% rename from caas/k8s/ingress/README.md rename to caas/kubernetes/ingress/README.md index 819248f..7ba4994 100644 --- a/caas/k8s/ingress/README.md +++ b/caas/kubernetes/ingress/README.md @@ -1,10 +1,10 @@ -# CAAS K8S INGRESS DataDog monitors +# CAAS KUBERNETES INGRESS DataDog monitors ## How to use this module ``` -module "datadog-monitors-caas-k8s-ingress" { - source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//caas/k8s/ingress?ref={revision}" +module "datadog-monitors-caas-kubernetes-ingress" { + source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//caas/kubernetes/ingress?ref={revision}" environment = "${var.environment}" message = "${module.datadog-message-alerting.alerting-message}" @@ -16,7 +16,7 @@ module "datadog-monitors-caas-k8s-ingress" { Creates DataDog monitors with the following checks: -- Nginx Ingress 5xx errors too high for {{ingress_class.name}} on {{upstream.name}} +- Nginx Ingress 5xx errors ## Inputs @@ -36,7 +36,6 @@ Creates DataDog monitors with the following checks: | ingress_5xx_timeframe | Monitor timeframe for Ingress 5xx errors [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 | | new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | -| team | Global Terraform | string | `k8s` | no | ## Outputs @@ -74,7 +73,7 @@ datadog: # Adapt the tags to the current convention and verify that the monitor will match tags: - dd_monitoring:enabled - - dd_k8s_ingress:enabled + - dd_ingress:enabled - dd_ingress_class:nginx - env:prod ``` diff --git a/caas/k8s/ingress/inputs.tf b/caas/kubernetes/ingress/inputs.tf similarity index 96% rename from caas/k8s/ingress/inputs.tf rename to caas/kubernetes/ingress/inputs.tf index b96012e..65ed192 100644 --- a/caas/k8s/ingress/inputs.tf +++ b/caas/kubernetes/ingress/inputs.tf @@ -1,9 +1,4 @@ # Global Terraform -variable "team" { - type = "string" - default = "k8s" -} - variable "environment" { description = "Architecture Environment" type = "string" diff --git a/caas/k8s/ingress/modules.tf b/caas/kubernetes/ingress/modules.tf similarity index 100% rename from caas/k8s/ingress/modules.tf rename to caas/kubernetes/ingress/modules.tf diff --git a/caas/k8s/ingress/monitors-ingress.tf b/caas/kubernetes/ingress/monitors-ingress.tf similarity index 81% rename from caas/k8s/ingress/monitors-ingress.tf rename to caas/kubernetes/ingress/monitors-ingress.tf index ee472bc..2cce3c3 100644 --- a/caas/k8s/ingress/monitors-ingress.tf +++ b/caas/kubernetes/ingress/monitors-ingress.tf @@ -1,6 +1,6 @@ resource "datadog_monitor" "Nginx_ingress_too_many_5xx" { count = "${var.ingress_5xx_enabled ? 1 : 0}" - name = "[${var.environment}] [${var.team}] Nginx Ingress 5xx errors too high for {{ingress_class.name}} on {{upstream.name}} {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" + name = "[${var.environment}] Nginx Ingress 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.ingress_5xx_message, var.message)}" query = <