From ff338dad609afb2725c2c51ce531f7b1bda97405 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Tue, 18 Sep 2018 15:20:20 +0200 Subject: [PATCH] MON-105 update tagging convention and add extra tags --- database/postgresql/inputs.tf | 12 ++++++++++++ database/postgresql/monitors-postgresql.tf | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/database/postgresql/inputs.tf b/database/postgresql/inputs.tf index 68f2a69..a875f3d 100644 --- a/database/postgresql/inputs.tf +++ b/database/postgresql/inputs.tf @@ -55,6 +55,12 @@ variable "postgresql_connection_enabled" { default = "true" } +variable "postgresql_connection_extra_tags" { + description = "Extra tags for PostgreSQL connection connects monitor" + type = "list" + default = [] +} + variable "postgresql_connection_message" { description = "Custom message for PostgreSQL connection monitor" type = "string" @@ -100,6 +106,12 @@ variable "postgresql_lock_enabled" { default = "true" } +variable "postgresql_lock_extra_tags" { + description = "Extra tags for PostgreSQL lock connects monitor" + type = "list" + default = [] +} + variable "postgresql_lock_message" { description = "Custom message for PostgreSQL lock monitor" type = "string" diff --git a/database/postgresql/monitors-postgresql.tf b/database/postgresql/monitors-postgresql.tf index 30fac1c..fb47486 100644 --- a/database/postgresql/monitors-postgresql.tf +++ b/database/postgresql/monitors-postgresql.tf @@ -26,7 +26,7 @@ resource "datadog_monitor" "postgresql_connection_too_high" { silenced = "${var.postgresql_connection_silenced}" - tags = ["env:${var.environment}", "resource:postgresql"] + tags = ["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform", "${var.postgresql_connection_extra_tags}"] } resource "datadog_monitor" "postgresql_too_many_locks" { @@ -57,5 +57,5 @@ resource "datadog_monitor" "postgresql_too_many_locks" { silenced = "${var.posgresql_lock_silenced}" - tags = ["env:${var.environment}", "resource:postgresql"] + tags = ["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform", "${var.postgresql_lock_extra_tags}"] }