From 7ce204e8ccd9251094dcc9c4b95f33204ecb8ea5 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Mon, 2 Sep 2024 11:58:21 -0300 Subject: [PATCH] Fix alert policy config module The way it is right now raises an "Inconsistent types" error if you have more than one policy. --- modules/config/alert_policies.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/config/alert_policies.tf b/modules/config/alert_policies.tf index 475d3b6..48db46f 100644 --- a/modules/config/alert_policies.tf +++ b/modules/config/alert_policies.tf @@ -1,7 +1,7 @@ # https://docs.opsgenie.com/docs/alert-api resource "opsgenie_alert_policy" "this" { - for_each = module.this.enabled ? { for policy in local.alert_policies : policy.name => policy } : {} + for_each = module.this.enabled ? { for policy in local.alert_policies : policy.name => policy } : tomap() name = each.value.name policy_description = try(each.value.policy_description, each.value.name)