Jeff’s Note #
“Unlike generic exam dumps, ADH analyzes this scenario through the lens of a Real-World Lead Developer.”
“For DVA-C02 candidates, the confusion often lies in where to apply event filtering for efficiency and correctness. In production, this is about understanding how EventBridge Pipes integrates with Lambda and filters events without duplicating logic or missing edge cases. Let’s drill down.”
The Certification Drill (Simulated Question) #
Scenario #
StreamFlow Inc., a company providing live sports streaming, leverages EventBridge Pipes to orchestrate event flows originating from an Amazon SQS queue. Each incoming event represents a video stream status update. A Lambda function invoked by the pipe enriches each event by fetching the current stream status from a DynamoDB table. StreamFlow wants the pipe to forward events to an EventBridge event bus only if the stream status is “ready”. Events for streams in any other state should be filtered out before reaching the event bus.
The Requirement: #
Design the EventBridge Pipes workflow to ensure that only events with a stream status of “ready” are published to the target event bus.
The Options #
- A) Add a filter step in the EventBridge Pipe definition that matches events with a stream status of “ready.”
- B) Modify the Lambda function so that it returns only events where the stream status is “ready,” discarding others.
- C) Add a filter for stream status “ready” on all EventBridge rules that subscribe to the event bus.
- D) Use an input transformer on the pipe’s output to filter only those streams with a status of “ready.”
Google adsense #
leave a comment:
Correct Answer #
A
Quick Insight: The Developer Imperative #
The right place to implement filtering within an EventBridge Pipe is the filter step of the pipe itself. This avoids unnecessary processing downstream and reduces event noise.
Modifying the Lambda to conditionally drop events (Option B) is more complex and breaks the Lambda’s enrichment responsibility.
Filtering only at the EventBridge rule level (Option C) means unwanted events still traverse the pipe and target bus, potentially incurring more cost and latency.
Using an input transformer (Option D) is for modifying event format, not filtering.
Content Locked: The Expert Analysis #
You’ve identified the answer. But do you know the implementation details that separate a Junior from a Senior?
The Expert’s Analysis #
Correct Answer #
Option A
The Winning Logic #
The EventBridge Pipes service allows you to define a filter step that applies conditional matching on event attributes at the pipe level before events proceed downstream. This approach cleanly separates concerns:
- The Lambda function’s role remains enriching each event with the stream status without needing to decide to drop events or not.
- The pipe’s filter step evaluates the enriched event and only lets events with
"streamStatus": "ready"pass through. - This reduces downstream event bus traffic and eliminates unnecessary processing by subscriber rules.
This solution optimizes performance, cost, and maintenance by leveraging built-in pipe features for filtering rather than pushing filtering logic into Lambda or EventBridge rules.
The Trap (Distractor Analysis): #
- Option B: Lambda should enrich all events consistently. Adding filtering logic here complicates Lambda code, mixes responsibilities, and risks silent drops or retries.
- Option C: Filtering in EventBridge rules means all events reach the event bus first, increasing event bus costs and latency.
- Option D: Input transformers reshape event payloads; they cannot prevent events from being published, so they cannot serve as filters.
The Technical Blueprint #
Relevant CLI snippet to create an EventBridge pipe with a filter step (simplified):
aws pipes create-pipe \
--name stream-status-pipe \
--source-arn arn:aws:sqs:us-east-1:123456789012:StreamQueue \
--target-arn arn:aws:events:us-east-1:123456789012:event-bus/StreamEventBus \
--enrichment-arn arn:aws:lambda:us-east-1:123456789012:function:EnrichStreamStatus \
--filter '{ "source": ["aws.sqs"], "detail.streamStatus": ["ready"] }'
Note: The exact filter syntax in create-pipe may be a JSON event pattern that matches "detail.streamStatus": "ready" after enrichment.
The Comparative Analysis #
| Option | API Complexity | Performance Impact | Use Case |
|---|---|---|---|
| A | Medium | Efficient filtering before publishing, optimal | Best practice for clean pipe filtering |
| B | Higher (adds logic) | Lambda load increased and logic mixing | Avoid; breaks single responsibility |
| C | Low | Bus receives all events, higher cost and latency | Only catch-all fallback filtering |
| D | Low | Does not filter events, only transforms payload | Misuse of input transformer |
Real-World Application (Practitioner Insight) #
Exam Rule #
“For the exam, always use EventBridge Pipes’ built-in filter step to do event filtering when enriching with Lambda.”
Real World #
“In a real environment, pushing filtering to Lambda or subscriber rules increases complexity and cost. Efficient event-driven architectures implement filtering as close to the source as possible.”
(CTA) Stop Guessing, Start Mastering #
Disclaimer
This is a study note based on simulated scenarios for the AWS DVA-C02 exam.