Question #1050
A file processing company has a pipe in Amazon EventBridge Pipes that uses an Amazon Simple Queue Service (Amazon SQS) queue as an event source. The pipe publishes all source events to a target EventBridge event bus. Before events are published, the pipe uses an AWS Lambda function to retrieve the processing status of each file from a database and adds the processing status to each source event.
The company wants the pipe to publish events to the event bus only if the file has a status of processed.
Which solution will meet these requirements?
Add a filter step to the pipe that will match on a processing status of processed.
Update the Lambda function to return only files that have a status of processed.
Include a filter for a status of processed in all EventBridge rules that subscribe to the event bus.
Add an input transformer to the pipe output that filters files that have a status of processed.
Explanation
Answer A is correct because EventBridge Pipes supports event filtering using Amazon EventBridge event patterns. By adding a filter step after the Lambda enrichment, the pipe checks the processing status and only forwards events with 'processed' to the event bus. This prevents non-processed events from being published entirely.
Option B is incorrect because modifying the Lambda to return only processed files could cause unintended side effects, such as deleting unprocessed SQS messages without proper handling. Option C is incorrect because filtering at the EventBridge rule level would still publish all events to the bus, violating the requirement. Option D is incorrect because input transformers modify event structure but cannot filter events.
Key Points:
1. EventBridge Pipes can filter events after enrichment using event patterns.
2. Filtering at the pipe level ensures only valid events reach the target.
3. Lambda enrichment adds data but should not be used to filter events in this scenario.
Answer
The correct answer is: A