From 586511dfbede321a5d62a97d188993b0e54ea703 Mon Sep 17 00:00:00 2001 From: athiththan11 Date: Fri, 22 Nov 2024 12:17:32 +0530 Subject: [PATCH] Add and support tags --- .../monitor_scheduled_query_alert.tf | 2 ++ modules/azurerm/Monitor-Scheduled-Query-Alert/variables.tf | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/modules/azurerm/Monitor-Scheduled-Query-Alert/monitor_scheduled_query_alert.tf b/modules/azurerm/Monitor-Scheduled-Query-Alert/monitor_scheduled_query_alert.tf index 06d431ef..8b575365 100644 --- a/modules/azurerm/Monitor-Scheduled-Query-Alert/monitor_scheduled_query_alert.tf +++ b/modules/azurerm/Monitor-Scheduled-Query-Alert/monitor_scheduled_query_alert.tf @@ -20,6 +20,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert_v2" "scheduled_query_rules severity = each.value.severity evaluation_frequency = each.value.evaluation_frequency window_duration = each.value.window_duration + tags = merge(var.tags, { "enabled" : each.value.query_enabled }) action { action_groups = each.value.action_group_id_list @@ -65,6 +66,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert_v2" "count_trigger_schedul severity = each.value.severity evaluation_frequency = each.value.evaluation_frequency window_duration = each.value.window_duration + tags = merge(var.tags, { "enabled" : each.value.query_enabled }) action { action_groups = each.value.action_group_id_list diff --git a/modules/azurerm/Monitor-Scheduled-Query-Alert/variables.tf b/modules/azurerm/Monitor-Scheduled-Query-Alert/variables.tf index 2f3dd153..670b2768 100644 --- a/modules/azurerm/Monitor-Scheduled-Query-Alert/variables.tf +++ b/modules/azurerm/Monitor-Scheduled-Query-Alert/variables.tf @@ -63,3 +63,9 @@ variable "count_trigger_query_rules_alert" { threshold = number })) } + +variable "tags" { + description = "A mapping of tags to assign to the resource." + type = map(string) + default = {} +}