File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ resource "aws_kinesis_firehose_delivery_stream" "this_kinesis" {
7777 }
7878 tags = var. tags
7979}
80+ locals {
81+ oxbow_lambda_unwrap_sns_event = var. enable_group_events == true ? {} : var. sns_topic_arn == " " ? {} : { UNWRAP_SNS_ENVELOPE = true }
82+ group_eventlambda_unwrap_sns_event = var. sns_topic_arn == " " ? {} : { UNWRAP_SNS_ENVELOPE = true }
83+ }
8084
8185resource "aws_lambda_function" "this_lambda" {
8286 description = var. lambda_description
@@ -92,12 +96,10 @@ resource "aws_lambda_function" "this_lambda" {
9296 reserved_concurrent_executions = var. lambda_reserved_concurrent_executions
9397
9498 environment {
95- variables = {
99+ variables = merge ( {
96100 AWS_S3_LOCKING_PROVIDER = var.aws_s3_locking_provider
97101 RUST_LOG = " deltalake=${ var . rust_log_deltalake_debug_level } ,oxbow=${ var . rust_log_oxbow_debug_level } "
98- DYNAMO_LOCK_TABLE_NAME = var.dynamodb_table_name
99- UNWRAP_SNS_ENVELOPE = var.enable_group_events == true ? false : var.sns_topic_arn == " " ? false : true
100- }
102+ DYNAMO_LOCK_TABLE_NAME = var.dynamodb_table_name }, local. oxbow_lambda_unwrap_sns_event )
101103 }
102104 tags = var. tags
103105}
@@ -113,11 +115,10 @@ resource "aws_lambda_function" "group_events_lambda" {
113115 runtime = " provided.al2"
114116
115117 environment {
116- variables = {
117- RUST_LOG = var.rust_log_oxbow_debug_level
118- QUEUE_URL = aws_sqs_queue.oxbow_lambda_fifo_sqs[0 ].url
119- UNWRAP_SNS_ENVELOPE = var.sns_topic_arn == " " ? false : true
120- }
118+ variables = merge ({
119+ RUST_LOG = var.rust_log_oxbow_debug_level
120+ QUEUE_URL = aws_sqs_queue.oxbow_lambda_fifo_sqs[0 ].url
121+ }, local. group_eventlambda_unwrap_sns_event )
121122 }
122123}
123124
You can’t perform that action at this time.
0 commit comments