Skip to content

docs(lambda): explain event filter criteria composition - #39285

Open
caglarkc wants to merge 1 commit into
aws:mainfrom
caglarkc:docs/lambda-filter-criteria-23214
Open

caglarkc wants to merge 1 commit into
aws:mainfrom
caglarkc:docs/lambda-filter-criteria-23214

Conversation

@caglarkc

Copy link
Copy Markdown
Contributor

Issue # (if applicable)

Closes #23214.

Reason for this change

The originally malformed FilterCriteria example was fixed in #23085, but this issue remains open for a general explanation of how to construct and combine filters.

Description of changes

Explain FilterCriteria.filter serialization, AND across fields, OR across values and filter entries, and source-specific data fields. Add a DynamoDB event pattern with event-name alternatives and a nested string-prefix comparison, together with its exact FilterCriteria JSON.

Describe any new or updated permissions being added

None. This is a documentation-only change.

Description of how you validated changes

  • Built aws-cdk-lib using the dependency versions pinned by the current main branch.
  • Compiled and translated the new README example with jsii-rosetta using the repository fixture.
  • Executed the exact README example against a DynamoDB stream and Lambda event source mapping. Compared its synthesized FilterCriteria to the JSON in the documentation and checked the parsed event pattern.
  • Ran jest aws-lambda/test/event-source-mapping.test.ts --runInBand --coverage=false (47 tests passed).
  • Reviewed the documentation against the implementation and checked git diff --check.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@caglarkc
caglarkc deployed to automation October 15, 2026 09:37 — with GitHub Actions Active
@caglarkc
caglarkc deployed to automation October 15, 2026 09:37 — with GitHub Actions Active
@github-actions github-actions Bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Oct 15, 2026
@caglarkc
caglarkc deployed to automation October 15, 2026 09:37 — with GitHub Actions Active
@aws-cdk-automation
aws-cdk-automation requested a review from a team October 15, 2026 09:37
@maintainer-for-aws

Copy link
Copy Markdown

Automated review

A maintainer will still review this — treat the notes below as a starting point.

📌 Commit eac16ff

This PR adds a "Defining event filter criteria" subsection to the aws-lambda README (+50/-0), explaining how to compose event source mapping filter criteria: wrapping patterns in FilterCriteria.filter(), using FilterRule helpers, and the AND/OR combination semantics, with a worked DynamoDB example and its synthesized JSON. The documented serialization behavior, the FilterRule.or and FilterRule.beginsWith/prefix output, and the combination semantics all match the implementation and the linked AWS event-filtering guidance; the example resolves against the module's default fixture and demonstrates the feature. No issues found on this change.

🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional


Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Oct 15, 2026

This branch was successfully deployed

1 active deployment
automation — eac16fff Deployed Oct 15, 2026 by aws-cdk-automation via validate-pr #372621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(lambda): Improve FilterCriteria documentation

2 participants