Repository navigation
feat(aws-node-eventbridge-rule): add an EventBridge rule example with a content filter and a live test - #845
Merged
Conversation
… a content filter and a live test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
aws-node-eventbridge-rule: a Lambda function triggered by an Amazon EventBridge rule on the default event bus, with a content filter.Lesson: the
eventBridgeevent with apatterncreates a rule on the default bus, and EventBridge invokes the function only for matching events (source: orders.app,detail-type: OrderPlaced,detail.total >= 100). An order of 250 reaches the function; an order of 40 doesn't.Left out on purpose: a producer function or API (Try it publishes with
aws events put-events), custom buses (covered bycompose-eventbridge-custom-bus), schedules, input transformation, retry policy and dead-letter queue, AWS service event patterns (mentioned in How it works). No npm dependencies: the handler only logs.Files:
serverless.yml,handler.mjs(ESM,nodejs24.x,arm64),example.jsonwith ascriptcheck,test/smoke.mjs, README in the standard sections;npm run docsregeneratedexamples.jsonand the root README tables.Evidence
Serverless Framework 4.47.0, 2026-11-25.
node scripts/check-examples.mjs aws-node-eventbridge-rule0 errors,--package0 errors,npm run validate0 errors (24 examples, on the currentv4),npm test323 passed,npm run check-docsclean.us-east-1): deploy,put-eventswith totals 250 and 40,serverless logsshowed onlyOrder o-1001 placed: total 250, …; removed.scripts/test-example.mjs):>= 10stopped at thecheckstep:order o-21fcb3da-2 with a total of 40 reached the function.us-east-1oreu-west-1.npm audit: 0 vulnerabilities.Generated by Claude Code