From 339471b027cfc7dd508d82a0f411c28a31b9224a Mon Sep 17 00:00:00 2001 From: Laurent Piroelle Date: Tue, 5 Jun 2018 16:24:37 +0200 Subject: [PATCH] MON-91 Monitor with VPN tunnel scope and remove custom metrics tags since they are not fetched --- cloud/aws/vpn/README.md | 5 ++--- cloud/aws/vpn/inputs.tf | 9 ++------- cloud/aws/vpn/monitors-vpn.tf | 12 ++---------- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/cloud/aws/vpn/README.md b/cloud/aws/vpn/README.md index d2b78a4..21f3f2a 100644 --- a/cloud/aws/vpn/README.md +++ b/cloud/aws/vpn/README.md @@ -16,7 +16,7 @@ module "datadog-monitors-cloud-aws-vpn" { Creates DataDog monitors with the following checks: -- VPN Down +- VPN tunnel down ## Inputs @@ -24,8 +24,7 @@ Creates DataDog monitors with the following checks: |------|-------------|:----:|:-----:|:-----:| | delay | Delay in seconds for the metric evaluation | string | `900` | no | | environment | Architecture Environment | string | - | yes | -| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | -| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| filter_tags | Tags used for metrics filtering | string | `*` | no | | message | Message sent when an alert is triggered | string | - | yes | | vpn_status_message | Custom message for VPN status monitor | string | `` | no | | vpn_status_silenced | Groups to mute for VPN status monitor | map | `` | no | diff --git a/cloud/aws/vpn/inputs.tf b/cloud/aws/vpn/inputs.tf index b791f51..7e2b0c7 100644 --- a/cloud/aws/vpn/inputs.tf +++ b/cloud/aws/vpn/inputs.tf @@ -14,13 +14,8 @@ variable "message" { description = "Message sent when an alert is triggered" } -variable "filter_tags_use_defaults" { - description = "Use default filter tags convention" - default = "true" -} - -variable "filter_tags_custom" { - description = "Tags used for custom filtering when filter_tags_use_defaults is false" +variable "filter_tags" { + description = "Tags used for metrics filtering" default = "*" } diff --git a/cloud/aws/vpn/monitors-vpn.tf b/cloud/aws/vpn/monitors-vpn.tf index 3327573..db9ed1a 100644 --- a/cloud/aws/vpn/monitors-vpn.tf +++ b/cloud/aws/vpn/monitors-vpn.tf @@ -1,18 +1,10 @@ -data "template_file" "filter" { - template = "$${filter}" - - vars { - filter = "${var.filter_tags_use_defaults == "true" ? format("dd_monitoring:enabled,dd_aws_vpn:enabled,env:%s", var.environment) : "${var.filter_tags_custom}"}" - } -} - resource "datadog_monitor" "VPN_status" { - name = "[${var.environment}] VPN Down" + name = "[${var.environment}] VPN tunnel down" message = "${coalesce(var.vpn_status_message, var.message)}" query = <