From a7590e2cdf44fdbfacd3e531621e981173f86b82 Mon Sep 17 00:00:00 2001 From: badra001 Date: Tue, 8 Mar 2022 10:00:15 -0500 Subject: [PATCH] replace sns variables to lambda based on TF variables --- lambda.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lambda.tf b/lambda.tf index 3ff62c4..effd370 100644 --- a/lambda.tf +++ b/lambda.tf @@ -23,7 +23,11 @@ resource "aws_lambda_function" "lambda" { environment { variables = merge( local.lambda_environment_variables, - tomap({ "tf_module_version" = local._module_version }), + { + "tf_module_version" = local._module_version + SnsEnable = var.create && var.enable_sns + SnsTopicArn = var.create && var.enable_sns ? aws_sns_topic.topic[0].arn : null + } ) } timeouts {}