From e0636262744ed979e1caca3fff84f772e04f0dcf Mon Sep 17 00:00:00 2001 From: "Jorge E. Gamboa G." Date: Mon, 13 May 2024 17:18:56 +0200 Subject: [PATCH] Updating module --- generic/grafana/alerts/main.tf | 4 ++-- generic/grafana/alerts/variabels.tf | 8 ++++---- generic/grafana/setup/variables.tf | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generic/grafana/alerts/main.tf b/generic/grafana/alerts/main.tf index f2fb86f4..9d4e0f45 100644 --- a/generic/grafana/alerts/main.tf +++ b/generic/grafana/alerts/main.tf @@ -8,14 +8,14 @@ resource "grafana_rule_group" "this" { interval_seconds = 180 dynamic "rule" { - for_each = var.rules != null ? toset(keys(var.rules)) : [] + for_each = var.rules != null ? len(var.rules) : [] content { name = var.rules[rule.key].name condition = var.rules[rule.key].condition dynamic "data" { - for_each = var.rules[rule.key].data != null ? toset(keys(var.rules[rule.key].data)) : [] + for_each = var.rules[rule.key].data != null ? len(var.rules[rule.key].data) : [] content { ref_id = var.rules[rule.key].data[data.key].ref_id diff --git a/generic/grafana/alerts/variabels.tf b/generic/grafana/alerts/variabels.tf index 2a51f76c..89e22981 100644 --- a/generic/grafana/alerts/variabels.tf +++ b/generic/grafana/alerts/variabels.tf @@ -10,18 +10,18 @@ variable "name" { variable "rules" { description = "Rules for the grafana alerts" - type = object({ + type = list(object({ name = string condition = string - data = object({ + data = list(object({ ref_id = string time_range_start = number time_range_end = number datasource_uid = string model = string - }) + })) no_data_state = string exec_err_state = string summary = string - }) + })) } diff --git a/generic/grafana/setup/variables.tf b/generic/grafana/setup/variables.tf index 71ec1f8b..f0cdc6f4 100644 --- a/generic/grafana/setup/variables.tf +++ b/generic/grafana/setup/variables.tf @@ -5,7 +5,7 @@ variable "grafana_url" { variable "contact_point_name" { type = string - description = "Name for the " + description = "Name for the contact settings " } variable "slack_config" { @@ -13,8 +13,8 @@ variable "slack_config" { type = object({ disable_resolve_message = bool mention_channel = string - mention_groups = list(string) - mention_users = list(string) + mention_groups = string + mention_users = string text = string title = string url = string