From 229693babc7171e56b20404ff7dad9cd93283c06 Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:16:23 -0700 Subject: [PATCH] Move to local --- modules/signoz/main.tf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/signoz/main.tf b/modules/signoz/main.tf index ba29a305..0a25459f 100644 --- a/modules/signoz/main.tf +++ b/modules/signoz/main.tf @@ -1,3 +1,6 @@ +locals { + alertmanager_enabled = var.smtp_from != "" && var.smtp_username != "" && var.smtp_password != "" +} resource "kubernetes_namespace" "signoz" { metadata { @@ -31,7 +34,7 @@ spec: parameters: - name: "clickhouse.password" value: ${random_password.clickhouse-admin-password.result} - %{if var.smtp_from != "" and var.smtp_username != "" and var.smtp_password != ""} + %{if local.alertmanager_enabled} - name: "alertmanager.enabled" value: true - name: "alertmanager.additionalEnvs.ALERTMANAGER_SMTP_FROM"