Skip to content

Commit

Permalink
Merge pull request #118 from athiththan11/patch-v0.19.x-tags
Browse files Browse the repository at this point in the history
Add & Support Tags for Monitor-Scheduled-Query-Alert
  • Loading branch information
athiththan11 authored Nov 22, 2024
2 parents a426b55 + c8a61f7 commit 9967760
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "scheduled_query_rules_al
severity = each.value.severity
frequency = each.value.frequency
time_window = each.value.time_window
tags = merge(var.tags, { "enabled" : each.value.query_enabled })

action {
action_group = each.value.action_group_id_list
Expand Down Expand Up @@ -51,6 +52,7 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "count_trigger_scheduled_
severity = each.value.severity
frequency = each.value.frequency
time_window = each.value.time_window
tags = merge(var.tags, { "enabled" : each.value.query_enabled })

action {
action_group = each.value.action_group_id_list
Expand Down
6 changes: 6 additions & 0 deletions modules/azurerm/Monitor-Scheduled-Query-Alert/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,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 = {}
}

0 comments on commit 9967760

Please sign in to comment.