MON-79 add subscription_id to filter on

This commit is contained in:
Quentin Manfroi 2017-11-03 20:10:03 +01:00
parent 4e0be10d97
commit 3cbd81df8a
3 changed files with 8 additions and 2 deletions

View File

@ -9,8 +9,8 @@ module "datadog-monitors-azure-storage" {
source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//cloud/azure/storage?ref={revision}"
message = "${module.datadog-message-alerting.alerting-message}"
environment = "${var.environment}"
subscription_id = "${var.subscription_id}"
}
```
@ -35,6 +35,7 @@ Inputs
|------|-------------|:----:|:-----:|:-----:|
| delay | Delay in seconds for the metric evaluation | string | `600` | no |
| environment | Architecture environment | string | - | yes |
| subscription_id | Azure account id used as filter for monitors | string | - | yes |
| message | Message sent when a monitor is triggered | string | - | yes |
| use_filter_tags | Filter the data with service tags if true | string | `true` | no |
| availability_threshold_critical | Minimum threshold of availability | string | `90` | no |

View File

@ -4,6 +4,11 @@ variable "environment" {
type = "string"
}
variable "subscription_id" {
description = "Azure account id used as filter for monitors"
type = "string"
}
variable "provider" {
description = "Cloud provider which the monitor and its based metric depend on"
type = "string"

View File

@ -2,7 +2,7 @@ data "template_file" "filter" {
template = "$${filter}"
vars {
filter = "${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_storage:enabled,env:%s", var.environment) : "*"}"
filter = "${var.use_filter_tags == "true" ? format("dd_monitoring:enabled,dd_azure_storage:enabled,env:%s", var.environment) : "subscription_id:${var.subscription_id}"}"
}
}