From 89102fbb1f6f14b95aa493c8e2b0390fb2f58d5d Mon Sep 17 00:00:00 2001 From: Quentin Manfroi <2693213+xp-1000@users.noreply.github.com> Date: Fri, 25 Jun 2021 11:33:40 +0200 Subject: [PATCH] fix closing resources for azure storage monitors (#7) --- cloud/azure/storage/monitors-azure-storage.tf | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index ee6d57e..777b015 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -28,7 +28,6 @@ EOQ tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.status_extra_tags) } - resource "datadog_monitor" "blobservices_requests_error" { count = var.successful_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Storage Blob service too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" @@ -227,8 +226,8 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) +} resource "datadog_monitor" "queueservices_latency" { count = var.latency_enabled == "true" ? 1 : 0 @@ -260,8 +259,8 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) +} resource "datadog_monitor" "tableservices_latency" { count = var.latency_enabled == "true" ? 1 : 0 @@ -293,8 +292,8 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) +} resource "datadog_monitor" "blob_timeout_error_requests" { count = var.timeout_error_requests_enabled == "true" ? 1 : 0 @@ -529,8 +528,8 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) +} resource "datadog_monitor" "table_network_error_requests" { count = var.network_error_requests_enabled == "true" ? 1 : 0 @@ -597,8 +596,8 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) +} resource "datadog_monitor" "file_throttling_error_requests" { count = var.throttling_error_requests_enabled == "true" ? 1 : 0 @@ -632,6 +631,7 @@ EOQ renotify_interval = 0 tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) +} resource "datadog_monitor" "queue_throttling_error_requests" { count = var.throttling_error_requests_enabled == "true" ? 1 : 0 @@ -701,8 +701,6 @@ EOQ tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) } - - resource "datadog_monitor" "blob_server_other_error_requests" { count = var.server_other_error_requests_enabled == "true" ? 1 : 0 name = "${var.prefix_slug == "" ? "" : "[${var.prefix_slug}]"}[${var.environment}] Azure Blob Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" @@ -802,8 +800,8 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) +} resource "datadog_monitor" "table_server_other_error_requests" { count = var.server_other_error_requests_enabled == "true" ? 1 : 0 @@ -937,8 +935,8 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) +} resource "datadog_monitor" "table_client_other_error_requests" { count = var.client_other_error_requests_enabled == "true" ? 1 : 0 @@ -1039,8 +1037,8 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) +} resource "datadog_monitor" "queue_authorization_error_requests" { count = var.authorization_error_requests_enabled == "true" ? 1 : 0