Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 6c48dff

Browse files
authored
fix(webhook): Don't set ${SQS_WORKFLOW_JOB_QUEUE} to empty string (#3943)
We currently indicate that this feature is disabled by setting the env var to an empty string. But instead we could omit it, to avoid polluting the environment, and causing a warning to be logged. This is a companion to #3942. That one stops the warning mentioned, this one fixes the original cause by not setting the env var in the first place. Both could be merged, ideally.
1 parent 40cfba7 commit 6c48dff

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Diff for: modules/webhook/webhook.tf

+11-9
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ resource "aws_lambda_function" "webhook" {
2323

2424
environment {
2525
variables = {
26-
LOG_LEVEL = var.log_level
27-
POWERTOOLS_LOGGER_LOG_EVENT = var.log_level == "debug" ? "true" : "false"
28-
POWERTOOLS_TRACE_ENABLED = var.tracing_config.mode != null ? true : false
29-
POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS = var.tracing_config.capture_http_requests
30-
POWERTOOLS_TRACER_CAPTURE_ERROR = var.tracing_config.capture_error
31-
PARAMETER_GITHUB_APP_WEBHOOK_SECRET = var.github_app_parameters.webhook_secret.name
32-
REPOSITORY_ALLOW_LIST = jsonencode(var.repository_white_list)
33-
SQS_WORKFLOW_JOB_QUEUE = try(var.sqs_workflow_job_queue, null) != null ? var.sqs_workflow_job_queue.id : ""
34-
PARAMETER_RUNNER_MATCHER_CONFIG_PATH = aws_ssm_parameter.runner_matcher_config.name
26+
for k, v in {
27+
LOG_LEVEL = var.log_level
28+
POWERTOOLS_LOGGER_LOG_EVENT = var.log_level == "debug" ? "true" : "false"
29+
POWERTOOLS_TRACE_ENABLED = var.tracing_config.mode != null ? true : false
30+
POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS = var.tracing_config.capture_http_requests
31+
POWERTOOLS_TRACER_CAPTURE_ERROR = var.tracing_config.capture_error
32+
PARAMETER_GITHUB_APP_WEBHOOK_SECRET = var.github_app_parameters.webhook_secret.name
33+
REPOSITORY_ALLOW_LIST = jsonencode(var.repository_white_list)
34+
SQS_WORKFLOW_JOB_QUEUE = try(var.sqs_workflow_job_queue.id, null)
35+
PARAMETER_RUNNER_MATCHER_CONFIG_PATH = aws_ssm_parameter.runner_matcher_config.name
36+
} : k => v if v != null
3537
}
3638
}
3739

0 commit comments

Comments
 (0)