DOP-C02 practice question: EventBridge rules and event-driven responses (1 of 3)
Incident and Event Response A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.
A logistics company's fleet service publishes a ShipmentStatusChanged event to the default event bus in Amazon EventBridge for every status update. The event detail includes a status field such as IN_TRANSIT, DELIVERED or EXCEPTION.
A support Lambda function must open a ticket only when the status is EXCEPTION. Operations also wants to see each event in the rule's metrics and logs. The fleet service team cannot change its code, and the ticketing function should not receive the other events.
Which approach meets these requirements with the LEAST operational overhead?
Choose one answer.
AA. Create a Lambda function that reads every ShipmentStatusChanged event from an S3 export, checks the status field, and opens a ticket for each exception.
BB. Create an EventBridge rule on the default event bus with an event pattern that matches the detail-type and the detail status value EXCEPTION, and set the support Lambda function as its target.
CC. Have the fleet service call the ticketing Lambda function directly for every status update, and let the function return early when the status is not EXCEPTION.
DD. Create an SNS topic, subscribe the support function, and publish every ShipmentStatusChanged event to the topic with a filter policy on the message body.
Show the answer and explanation
Answer: B
A. Wrong: The events are not exported to S3 in this design, so the function would have no input. Even if they were, a batch export adds a delay and a function that the team maintains.
B. Right: Correct. The event pattern filters on the detail's status field, so the rule invokes the function only for exceptions and the fleet service is unchanged. EventBridge does the filtering, with no code to maintain. Learn more: Amazon EventBridge event patterns (opens in a new tab)
C. Wrong: The fleet service would have to change its code, which the team cannot do. The function would also be invoked for every update, which adds cost and noise.
D. Wrong: SNS can filter on the message body, but something would have to republish each event from the bus to the topic, which adds a path to build and maintain. The EventBridge rule already filters the events where they arrive. Learn more: Amazon SNS message filtering (opens in a new tab)
Explanation
An EventBridge rule with an event pattern matches on the detail's status field, so only EXCEPTION events invoke the support function. The fleet service keeps its code, and nothing polls. Exports and direct calls add work or change the producer, and republishing to SNS adds a second path to maintain.
Want more on EventBridge rules and event-driven responses? The 5 full-length practice sets have 13 more EventBridge rules and event-driven responses questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →