Skip to content

fix(lambda): uppercase LOG_LEVEL for shared and v2 job retry modules - #5303

Open
zxkane wants to merge 3 commits into
github-aws-runners:mainfrom
zxkane:fix/lambda-module-log-level
Open

zxkane wants to merge 3 commits into
github-aws-runners:mainfrom
zxkane:fix/lambda-module-log-level

Conversation

@zxkane

@zxkane zxkane commented Aug 27, 2026 •

Copy link
Copy Markdown

Description

Follow-up to #5238: normalize LOG_LEVEL with upper() in the shared modules/lambda module and the v2 modules/orchestration-providers/webhook/job-retry module so Powertools Logger receives the uppercase environment values it expects.

This covers legacy job retry and termination-watcher functions as well as v2 job retry, as requested in review. Both job-retry implementations now produce consistent log-level values during v1-to-v2 migration. POWERTOOLS_LOGGER_LOG_EVENT still uses the original lowercase input, and explicit caller-provided environment overrides retain their precedence.

Validation

  • Terraform 1.14.6: repository-wide terraform fmt -recursive -check=true -write=false passed.
  • v2 job-retry module: terraform init -backend=false -input=false, terraform validate, and terraform test passed (7 tests).
  • Regression assertions first failed on the previous implementation for lowercase trace and debug, then passed after the fix. Coverage checks uppercase values in the planned Lambda environment, debug-only event logging, and explicit LOG_LEVEL override precedence.
  • Independent source review found no blocking issues.
  • Follow-up commit 85ae5468798a8282e3b10ec9783b7ccec886be13 is SSH-signed; GitHub reports the signature as Verified.

The semantic commit check passed on the updated head. Terraform checks, Terraform lifecycle (including migration tests), smoke tests, CodeQL, dependency review, and OSV scanning require upstream approval to run this fork PR (action_required); these checks have not run on the new commit. The previous head failed four migration-test jobs because the v2 job-retry Lambda required an infrastructure update.

@zxkane
zxkane requested a review from a team as a code owner August 27, 2026 06:15

@edersonbrilhante edersonbrilhante left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zxkane Good catch

@edersonbrilhante edersonbrilhante left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zxkane Please sign your commit

@zxkane
zxkane force-pushed the fix/lambda-module-log-level branch from dec99d4 to e1dbc85 Compare October 9, 2026 16:30
PR github-aws-runners#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.
@zxkane
zxkane force-pushed the fix/lambda-module-log-level branch from e1dbc85 to 6c22bfa Compare October 9, 2026 16:31
@edersonbrilhante

Copy link
Copy Markdown
Contributor

@zxkane Can you also fix in v2 modules modules/orchestration-providers/webhook?

@zxkane zxkane changed the title fix(lambda): uppercase LOG_LEVEL in the shared lambda module fix(lambda): uppercase LOG_LEVEL for shared and v2 job retry modules Nov 10, 2026
@zxkane

zxkane commented Nov 10, 2026

Copy link
Copy Markdown
Author

@edersonbrilhante I've added the same fix to the v2 webhook job-retry module in 85ae546. The commit is signed and verified by GitHub.

All 7 local Terraform tests pass, including regression coverage for uppercase log levels, debug-only event logging, and environment override precedence. Formatting and validation also pass.

Could you take another look and approve the pending CI runs? Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants