MON-247 add extra tags and enabled feature

This commit is contained in:
Quentin Manfroi 2018-09-03 09:51:23 +02:00
parent d8709927e1
commit 3ee6fcd2e7
2 changed files with 14 additions and 1 deletions

View File

@ -48,6 +48,18 @@ variable "ark_schedules_monitor_silenced" {
default = {} default = {}
} }
variable "ark_schedules_enabled" {
description = "Flag to enable Ark schedules monitor"
type = "string"
default = "true"
}
variable "ark_schedules_extra_tags" {
description = "Extra tags for Ark schedules monitor"
type = "list"
default = []
}
variable "ark_schedules_monitor_no_data_timeframe" { variable "ark_schedules_monitor_no_data_timeframe" {
description = "No data timeframe" description = "No data timeframe"
default = 1440 default = 1440

View File

@ -1,4 +1,5 @@
resource "datadog_monitor" "ark_schedules_monitor" { resource "datadog_monitor" "ark_schedules_monitor" {
count = "${var.ark_schedules_enabled ? 1 : 0}"
name = "[${var.environment}] Ark backup failed on {{schedule.name}}" name = "[${var.environment}] Ark backup failed on {{schedule.name}}"
type = "metric alert" type = "metric alert"
message = "${coalesce(var.ark_schedules_monitor_message, var.message)}" message = "${coalesce(var.ark_schedules_monitor_message, var.message)}"
@ -25,5 +26,5 @@ resource "datadog_monitor" "ark_schedules_monitor" {
require_full_window = false require_full_window = false
silenced = "${var.ark_schedules_monitor_silenced}" silenced = "${var.ark_schedules_monitor_silenced}"
tags = ["env:${var.environment}", "type:caas", "provider:prometheus", "resource:ark", "team:claranet", "created-by:terraform"] tags = ["env:${var.environment}", "type:caas", "provider:prometheus", "resource:ark", "team:claranet", "created-by:terraform", "${var.ark_schedules_extra_tags}"]
} }