Skip to content

fix(parser): keep policyLevel in CloudWatch Logs decoded payload - #6024

Open
nursnaaz wants to merge 1 commit into
aws-powertools:mainfrom
nursnaaz:fix/parser-cloudwatch-policy-level
Open

nursnaaz wants to merge 1 commit into
aws-powertools:mainfrom
nursnaaz:fix/parser-cloudwatch-policy-level

Conversation

@nursnaaz

Copy link
Copy Markdown

Summary

Changes

CloudWatchLogsDecodeSchema now has an optional policyLevel string. Payloads from account-level subscription filters carry "policyLevel": "ACCOUNT_LEVEL_POLICY" (AWS docs). Zod dropped the unknown key, so CloudWatchLogsSchema and the CloudWatch Logs envelope lost it. The Python version of Powertools already models the field.

The field is optional, so events without it parse as before.

Verification

I added a test that gzips the documented account-level payload and parses it. It fails on main (policyLevel missing from the result) and passes with the change. The parser unit tests pass (422 of 422) with 100% coverage. biome lint and the build:tests type check pass. Local Node is v22, not the pinned v26.

Generated by AI tools, and reviewed and verified by Mohamed Noordeen Alaudeen (@nursnaaz).

Issue number: closes #6023


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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

size/M PR between 30-99 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: parser CloudWatch Logs schema drops policyLevel

1 participant