MON-32 update tag convention and add extra tags

This commit is contained in:
Quentin Manfroi 2018-09-19 19:24:32 +02:00
parent 84af5591b9
commit 22d1cbc4ae
6 changed files with 84 additions and 12 deletions

View File

@ -35,6 +35,12 @@ variable "eviction_silenced" {
type = "map" type = "map"
} }
variable "eviction_extra_tags" {
description = "Extra tags for Elasticache eviction monitor"
type = "list"
default = []
}
variable "eviction_message" { variable "eviction_message" {
description = "Custom message for Elasticache eviction monitor" description = "Custom message for Elasticache eviction monitor"
type = "string" type = "string"
@ -54,6 +60,12 @@ variable "max_connection_silenced" {
type = "map" type = "map"
} }
variable "max_connection_extra_tags" {
description = "Extra tags for Elasticache max connection monitor"
type = "list"
default = []
}
variable "max_connection_message" { variable "max_connection_message" {
description = "Custom message for Elasticache max connection monitor" description = "Custom message for Elasticache max connection monitor"
type = "string" type = "string"
@ -73,6 +85,12 @@ variable "no_connection_silenced" {
type = "map" type = "map"
} }
variable "no_connection_extra_tags" {
description = "Extra tags for Elasticache no connection monitor"
type = "list"
default = []
}
variable "no_connection_message" { variable "no_connection_message" {
description = "Custom message for Elasticache no connection monitor" description = "Custom message for Elasticache no connection monitor"
type = "string" type = "string"
@ -92,6 +110,12 @@ variable "swap_silenced" {
type = "map" type = "map"
} }
variable "swap_extra_tags" {
description = "Extra tags for Elasticache swap monitor"
type = "list"
default = []
}
variable "swap_message" { variable "swap_message" {
description = "Custom message for Elasticache swap monitor" description = "Custom message for Elasticache swap monitor"
type = "string" type = "string"
@ -119,6 +143,12 @@ variable "free_memory_silenced" {
type = "map" type = "map"
} }
variable "free_memory_extra_tags" {
description = "Extra tags for Elasticache free memory monitor"
type = "list"
default = []
}
variable "free_memory_message" { variable "free_memory_message" {
description = "Custom message for Elasticache free memory monitor" description = "Custom message for Elasticache free memory monitor"
type = "string" type = "string"
@ -145,6 +175,12 @@ variable "eviction_growing_silenced" {
type = "map" type = "map"
} }
variable "eviction_growing_extra_tags" {
description = "Extra tags for Elasticache eviction growing monitor"
type = "list"
default = []
}
variable "eviction_growing_message" { variable "eviction_growing_message" {
description = "Custom message for Elasticache eviction growing monitor" description = "Custom message for Elasticache eviction growing monitor"
type = "string" type = "string"

View File

@ -22,7 +22,7 @@ resource "datadog_monitor" "elasticache_eviction" {
silenced = "${var.eviction_silenced}" silenced = "${var.eviction_silenced}"
tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform", "${var.eviction_extra_tags}"]
} }
resource "datadog_monitor" "elasticache_max_connection" { resource "datadog_monitor" "elasticache_max_connection" {
@ -49,7 +49,7 @@ resource "datadog_monitor" "elasticache_max_connection" {
silenced = "${var.max_connection_silenced}" silenced = "${var.max_connection_silenced}"
tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform", "${var.max_connection_extra_tags}"]
} }
resource "datadog_monitor" "elasticache_no_connection" { resource "datadog_monitor" "elasticache_no_connection" {
@ -76,7 +76,7 @@ resource "datadog_monitor" "elasticache_no_connection" {
silenced = "${var.no_connection_silenced}" silenced = "${var.no_connection_silenced}"
tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform", "${var.no_connection_extra_tags}"]
} }
resource "datadog_monitor" "elasticache_swap" { resource "datadog_monitor" "elasticache_swap" {
@ -108,7 +108,7 @@ resource "datadog_monitor" "elasticache_swap" {
silenced = "${var.swap_silenced}" silenced = "${var.swap_silenced}"
tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform", "${var.swap_extra_tags}"]
} }
# POC - A approfondir # POC - A approfondir
@ -141,7 +141,7 @@ resource "datadog_monitor" "elasticache_free_memory" {
silenced = "${var.free_memory_silenced}" silenced = "${var.free_memory_silenced}"
tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform", "${var.free_memory_extra_tags}"]
} }
resource "datadog_monitor" "elasticache_eviction_growing" { resource "datadog_monitor" "elasticache_eviction_growing" {
@ -173,5 +173,5 @@ resource "datadog_monitor" "elasticache_eviction_growing" {
silenced = "${var.eviction_growing_silenced}" silenced = "${var.eviction_growing_silenced}"
tags = ["env:${var.environment}", "engine:${var.resource}", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache", "team:claranet", "created-by:terraform", "${var.eviction_growing_extra_tags}"]
} }

View File

@ -36,6 +36,12 @@ variable "get_hits_silenced" {
default = {} default = {}
} }
variable "get_hits_extra_tags" {
description = "Extra tags for Elasticache memcached get hits monitor"
type = "list"
default = []
}
variable "get_hits_message" { variable "get_hits_message" {
description = "Custom message for Elasticache memcached get hits monitor" description = "Custom message for Elasticache memcached get hits monitor"
type = "string" type = "string"
@ -63,6 +69,12 @@ variable "cpu_high_silenced" {
default = {} default = {}
} }
variable "cpu_high_extra_tags" {
description = "Extra tags for Elasticache memcached cpu high monitor"
type = "list"
default = []
}
variable "cpu_high_message" { variable "cpu_high_message" {
description = "Custom message for Elasticache memcached cpu high monitor" description = "Custom message for Elasticache memcached cpu high monitor"
type = "string" type = "string"

View File

@ -84,7 +84,7 @@ resource "datadog_monitor" "memcached_get_hits" {
silenced = "${var.get_hits_silenced}" silenced = "${var.get_hits_silenced}"
tags = ["env:${var.environment}", "engine:memcached", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-memcached", "team:claranet", "created-by:terraform", "${var.get_hits_extra_tags}"]
} }
resource "datadog_monitor" "memcached_cpu_high" { resource "datadog_monitor" "memcached_cpu_high" {
@ -116,5 +116,5 @@ resource "datadog_monitor" "memcached_cpu_high" {
silenced = "${var.cpu_high_silenced}" silenced = "${var.cpu_high_silenced}"
tags = ["env:${var.environment}", "engine:memcached", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-memcached", "team:claranet", "created-by:terraform", "${var.cpu_high_extra_tags}"]
} }

View File

@ -36,6 +36,12 @@ variable "cache_hits_silenced" {
default = {} default = {}
} }
variable "cache_hits_extra_tags" {
description = "Extra tags for Elasticache redis cache hits monitor"
type = "list"
default = []
}
variable "cache_hits_message" { variable "cache_hits_message" {
description = "Custom message for Elasticache redis cache hits monitor" description = "Custom message for Elasticache redis cache hits monitor"
type = "string" type = "string"
@ -63,6 +69,12 @@ variable "cpu_high_silenced" {
default = {} default = {}
} }
variable "cpu_high_extra_tags" {
description = "Extra tags for Elasticache redis cpu high monitor"
type = "list"
default = []
}
variable "cpu_high_message" { variable "cpu_high_message" {
description = "Custom message for Elasticache redis cpu high monitor" description = "Custom message for Elasticache redis cpu high monitor"
type = "string" type = "string"
@ -96,6 +108,12 @@ variable "replication_lag_silenced" {
default = {} default = {}
} }
variable "replication_lag_extra_tags" {
description = "Extra tags for Elasticache redis replication lag monitor"
type = "list"
default = []
}
variable "replication_lag_message" { variable "replication_lag_message" {
description = "Custom message for Elasticache redis replication lag monitor" description = "Custom message for Elasticache redis replication lag monitor"
type = "string" type = "string"
@ -129,6 +147,12 @@ variable "commands_silenced" {
default = {} default = {}
} }
variable "commands_extra_tags" {
description = "Extra tags for Elasticache redis commands monitor"
type = "list"
default = []
}
variable "commands_message" { variable "commands_message" {
description = "Custom message for Elasticache redis commands monitor" description = "Custom message for Elasticache redis commands monitor"
type = "string" type = "string"

View File

@ -84,7 +84,7 @@ resource "datadog_monitor" "redis_cache_hits" {
silenced = "${var.cache_hits_silenced}" silenced = "${var.cache_hits_silenced}"
tags = ["env:${var.environment}", "engine:redis", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "${var.cache_hits_extra_tags}"]
} }
resource "datadog_monitor" "redis_cpu_high" { resource "datadog_monitor" "redis_cpu_high" {
@ -111,7 +111,7 @@ resource "datadog_monitor" "redis_cpu_high" {
silenced = "${var.cpu_high_silenced}" silenced = "${var.cpu_high_silenced}"
tags = ["env:${var.environment}", "engine:redis", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "${var.cpu_high_extra_tags}"]
} }
resource "datadog_monitor" "redis_replication_lag" { resource "datadog_monitor" "redis_replication_lag" {
@ -143,7 +143,7 @@ resource "datadog_monitor" "redis_replication_lag" {
silenced = "${var.replication_lag_silenced}" silenced = "${var.replication_lag_silenced}"
tags = ["env:${var.environment}", "engine:redis", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "${var.replication_lag_extra_tags}"]
} }
resource "datadog_monitor" "redis_commands" { resource "datadog_monitor" "redis_commands" {
@ -171,5 +171,5 @@ resource "datadog_monitor" "redis_commands" {
silenced = "${var.commands_silenced}" silenced = "${var.commands_silenced}"
tags = ["env:${var.environment}", "engine:redis", "team:aws", "provider:aws"] tags = ["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "${var.commands_extra_tags}"]
} }