How to schedule a daily Lambda invocation cost-effectively?
Short answer
D Create an Amazon EventBridge scheduled rule that invokes the Lambda function once each day at the predefined time.
Question
Key Takeaways
This question tests understanding of time-based scheduling versus event-driven triggers, emphasizing that EventBridge rules provide the most cost-effective and precise way to run a Lambda function on a daily schedule.
This question tests the most cost-effective way to trigger an AWS Lambda function once per day at a specific time to process aggregated data. The community overwhelmingly agrees that Amazon EventBridge scheduled rules are the best practice for time-based Lambda invocations.
Common mistake: Many candidates choose Option A (S3 event notification) because it seems simple and event-driven, but it triggers the Lambda function multiple times (once per branch upload) rather than a single time after all reports are uploaded, violating the requirement and increasing costs.
Expert Analysis
Why Option D is Correct
Amazon EventBridge scheduled rules are specifically designed for time-based automation in AWS. By creating a rule with a cron or rate expression (e.g., cron(0 9 ? *) for 9 AM UTC daily), the Lambda function is invoked exactly once at the predefined time. This satisfies the requirement of analyzing all branch reports in a single pass.
From a cost perspective, EventBridge scheduled rules are extremely inexpensive (free for AWS-originated events in many cases, and minimal cost for scheduled rules). The Lambda function only runs once per day, minimizing compute duration charges. Community comment [1] correctly notes that EventBridge is a "low-cost, highly efficient way to run tasks on a predefined schedule."
Why the Other Options Are Wrong
Option A (S3 event notification): This is the most common trap. An S3 event notification would trigger the Lambda function every time a branch uploads a report. If there are 10 branches, the function runs 10 times, each time likely finding incomplete data (not all reports have arrived yet). This violates the "single pass" requirement and dramatically increases cost due to multiple invocations and compute time. As community member [5] points out, "it will trigger with every report upload which is multiple invocations."
Option B (AWS Step Functions): Step Functions can schedule executions, but this is overkill for a simple daily trigger. Step Functions adds unnecessary complexity and cost (state transition charges) for a use case that only requires a basic cron-like schedule. Community comment [5] correctly identifies this as "over the top for this use case."
Option C (Lambda running continuously): This is the least cost-effective option. A Lambda function running continuously (e.g., with a loop and sleep) would incur charges for the entire duration, even when idle. Lambda is designed for short-lived, event-driven execution, not long-running processes. This would be extraordinarily expensive compared to a once-daily invocation.
Key Takeaway
When the requirement is to run a Lambda function at a specific time (not in response to an event), EventBridge scheduled rules are the AWS best practice. They are simple, cost-effective, and purpose-built for this scenario.
Official Reference
- https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html
- https://docs.aws.amazon.com/lambda/latest/dg/services-cloudwatchevents-scheduled.html
These links open the official vendor documentation in a new tab.
Exam Strategy
When a question asks for the 'MOST cost-effective' solution involving time-based triggers, always consider EventBridge scheduled rules first. Eliminate options that cause multiple invocations or continuous running, as these are red flags for cost inefficiency.
Community Votes
100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 6 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 6
-
DeaconStJohn 👍 4 Answered DA - This does not meet the criteria. it will trigger with every report upload which is multiple invocations. the requirement is a single invocation that analyses all reports at a predefined time. these invocations will be firing off all over the place as every report comes in. B - Step functions is over the top for this use case. C - lambda to run continuously... D - This is a single invocation that triggers the lambda function at a predefined time using CRON. Eventbridge was developed for this use case.
-
trungtd 👍 3 Answered DBest practice for cronjob in Lamda
-
KarBiswa 👍 2 Answered ALeast cost involved and simple
-
examuserss 👍 1 Answered DCorrect Answer: D. Create an Amazon EventBridge scheduled rule that invokes the Lambda function once each day at the predefined time. This solution allows you to trigger the Lambda function at the desired time each day without unnecessary compute usage and cost. EventBridge is ideal for time-based scheduling and provides a low-cost, highly efficient way to run tasks on a predefined schedule.
-
65703c1 👍 2 Answered DD is the correct answer.
Show 1 more comment
-
seetpt 👍 2 Answered DD is right
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →