MON-80 Now support use_filter_tags

This commit is contained in:
Alexandre Gaillet 2017-10-31 15:37:13 +01:00
parent c1563c3318
commit 9186c69150
2 changed files with 13 additions and 0 deletions

View File

@ -8,6 +8,11 @@ variable "client_name" {
type = "string"
}
variable "use_filter_tags" {
description = "Filter the data with service tags if true"
default = "true"
}
variable "subscription_id" {
description = "Subscription ID used to tag monitors"
type = "string"

View File

@ -1,3 +1,11 @@
data "template_file" "filter" {
template = "$${filter}"
vars {
filter = "${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_appservices:enabled,subscription_id:%s,env:%s", var.subscription_id,var.environment) : var.subscription_id}"
}
}
resource "datadog_monitor" "too_many_jobs_failed" {
name = "[${var.environment}] IOT Hub Too many jobs failed on {{name}}"
message = "${var.message}"