A developer is building a serverless application that publishes events to an Amazon EventBridge event bus. The developer needs to route all events to an Amazon Kinesis Data Firehose delivery stream for long-term archiving, and route only events with a status of "CANCELLED" to an AWS Lambda function for real-time alerting. Which two configurations should the developer implement to meet these requirements? (Select TWO.)
- Create an EventBridge rule with an event pattern that filters for a status of "CANCELLED" and associate it with the Lambda function target.Answer
- Create an EventBridge rule that matches all events and associate it with the Kinesis Data Firehose delivery stream target.Answer
- CConfigure the producer application to use a static partition key of "CANCELLED" for all events sent to EventBridge to prioritize processing.
- DConfigure a short timeout on the Lambda function, assuming EventBridge will automatically pause and resume the Lambda execution context if the processing takes too long.
- EModify the IAM trust policy of the AWS Lambda execution role to allow the EventBridge service to assume it directly.
Answer
To archive all events and send only cancelled events to Lambda, the developer should create one EventBridge rule that matches all events with Kinesis Data Firehose as the target, and a second EventBridge rule with a JSON pattern filtering for a status of "CANCELLED" with the Lambda function as the target.
The correct options involve creating two separate rules on the EventBridge event bus. The first rule matches all incoming events using a broad event pattern and targets the archiving Kinesis Data Firehose stream. The second rule uses a structured JSON event pattern to filter for events where the status field is "CANCELLED" and targets the alerting Lambda function.
Step-by-Step Solution
Key Concept
Event routing and filtering in Amazon EventBridge rules using event patterns.