From 2bcd766894099e580397a3fef83f2df22e6bf89d Mon Sep 17 00:00:00 2001 From: Matt White <16320656+matt-FFFFFF@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:04:04 +0100 Subject: [PATCH] fix: budget --- modules/budget/variables.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/budget/variables.tf b/modules/budget/variables.tf index 96fa6ba1..cf317484 100644 --- a/modules/budget/variables.tf +++ b/modules/budget/variables.tf @@ -45,9 +45,9 @@ variable "budget_notifications" { operator = string threshold = number threshold_type = optional(string, "Actual") - contact_emails = optional(list(string), []) - contact_roles = optional(list(string), []) - contact_groups = optional(list(string), []) + contact_emails = optional(list(string), null) + contact_roles = optional(list(string), null) + contact_groups = optional(list(string), null) locale = optional(string, "en-us") })) default = {} @@ -83,7 +83,7 @@ variable "budget_notifications" { } validation { condition = alltrue([ - for notification in var.budget_notifications : length(notification.contact_emails) > 0 || length(notification.contact_roles) > 0 || length(notification.contact_groups) > 0 + for notification in var.budget_notifications : can(coalescelist(notification.contact_emails, notification.contact_roles, notification.contact_groups)) ]) error_message = "At least one of contact_emails, contact_roles, or contact_groups must be supplied." }