From 6712d4a57b2a7bf9b7befef7c6da58712be72c1f Mon Sep 17 00:00:00 2001 From: Kane Zhu <843303+zxkane@users.noreply.github.com> Date: Thu, 27 Aug 2026 14:14:37 +0800 Subject: [PATCH] fix(lambda): uppercase LOG_LEVEL in the shared lambda module #5238 wrapped every LOG_LEVEL assignment with upper() so that Powertools v2 stops silently discarding the value, but it missed modules/lambda/main.tf. That module builds the environment for four functions: runners/job-retry, termination-watcher/deregister-retry, termination-watcher/notification and termination-watcher/termination. The variable is validated against lowercase names only ("debug", "info", "warn", "error"), so the value reaching those four functions can never match Powertools' uppercase LogLevelThreshold keys. Every level silently resolves to INFO. Requesting "debug" yields no debug output, and requesting "warn" or "error" yields more output than asked for. POWERTOOLS_LOGGER_LOG_EVENT keeps comparing the raw lowercase variable, which is still correct. Signed-off-by: Kane Zhu <843303+zxkane@users.noreply.github.com> --- modules/lambda/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lambda/main.tf b/modules/lambda/main.tf index 7cc3094f28..124a933d4a 100644 --- a/modules/lambda/main.tf +++ b/modules/lambda/main.tf @@ -3,7 +3,7 @@ locals { lambda_environment_variables = { ENVIRONMENT = var.lambda.prefix - LOG_LEVEL = var.lambda.log_level + LOG_LEVEL = upper(var.lambda.log_level) PREFIX = var.lambda.prefix POWERTOOLS_LOGGER_LOG_EVENT = var.lambda.log_level == "debug" ? "true" : "false" POWERTOOLS_SERVICE_NAME = var.lambda.name