From 1e81cd352316da30a677f52eab4229711768e453 Mon Sep 17 00:00:00 2001 From: Rohith Jayawardene Date: Sat, 27 Apr 2024 12:53:38 +0100 Subject: [PATCH] fix: the format for email notifications were incorrect --- locals.tf | 7 +++++++ main.tf | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/locals.tf b/locals.tf index 86313aa..8ccf12b 100644 --- a/locals.tf +++ b/locals.tf @@ -2,6 +2,13 @@ locals { ## Indicates if slack notifications are enabled enable_slack = var.notifications.slack != null ? true : false + ## Indicates if email notifications are enabled + enable_email = var.notifications.email != null ? true : false + + ## The configuration for email notifications if enabled + email = local.enable_email ? { + addresses = var.notifications.email.addresses + } : null ## The configuration for slack notifications if enabled slack = local.enable_slack ? { diff --git a/main.tf b/main.tf index 9043531..bff75ff 100644 --- a/main.tf +++ b/main.tf @@ -6,7 +6,7 @@ module "notifications" { allowed_aws_services = ["budgets.amazonaws.com", "lambda.amazonaws.com"] create_sns_topic = var.create_sns_topic - email = try(var.notifications.email.addresses, []) + email = local.email slack = local.slack sns_topic_name = var.sns_topic_name tags = var.tags