DOP-C02 practice question: EventBridge rules and event-driven responses (2 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 game studio needs a small job to run every 10 minutes to clear expired matchmaking tickets from a DynamoDB table. The table holds about 200,000 tickets, and the job takes about 20 seconds per run. The job is written as an AWS Lambda function.
The studio does not want to run a server or a cron host for the job, and it wants the schedule itself to be managed by AWS. Operations should also be able to see and change the schedule in the console.
Which approach meets these requirements?
Choose one answer.
AA. Create an EventBridge schedule with the expression rate(10 minutes) that invokes the Lambda function as its target.
BB. Install a cron job on a small EC2 instance that calls the Lambda function's Invoke API every 10 minutes, and keep the instance running.
CC. Create a Step Functions state machine with a Wait state of 10 minutes that calls the function and loops forever.
DD. Put a message on an SQS queue with a 10-minute delay each time the function finishes, and let the function re-send the message when it completes.
B. Wrong: This works, but it needs an instance to run, patch and monitor. The studio asked for no server or cron host.
C. Wrong: A looping state machine can run this job, but it keeps an execution open and adds a workflow to maintain for a simple schedule. The schedule service is the simpler managed choice. Learn more: What is Step Functions? (opens in a new tab)
An EventBridge schedule with a rate expression invokes Lambda at the set interval, and AWS manages the timing with no server. A cron host, a looping workflow and a self-rescheduling queue each add something the studio asked to avoid or a point of failure.
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 →