DVA-C02 · Question #350
A company with multiple branch locations has an analytics and reporting application. Each branch office pushes a sales report to a shared Amazon S3 bucket at a predefined time each day. The company ha
The correct answer is D. Create an Amazon EventBridge scheduled rule that invokes the Lambda function once each day. An Amazon EventBridge scheduled rule triggers a Lambda function once per day at a fixed time with no idle compute cost, making it the most cost-effective scheduling solution.
Question
A company with multiple branch locations has an analytics and reporting application. Each branch office pushes a sales report to a shared Amazon S3 bucket at a predefined time each day. The company has developed an AWS Lambda function that analyzes the reports from all branch offices in a single pass. The Lambda function stores the results in a database. The company needs to start the analysis once each day at a specific time. Which solution will meet these requirements MOST cost-effectively?
Options
- AConfigure an S3 event notification to invoke the Lambda function when a branch office uploads a
- BCreate an AWS Step Functions state machine that invokes the Lambda function once each day at
- CConfigure the Lambda function to run continuously and to begin analysis only at the predefined
- DCreate an Amazon EventBridge scheduled rule that invokes the Lambda function once each day
How the community answered
(39 responses)- A5% (2)
- B10% (4)
- C3% (1)
- D82% (32)
Why each option
An Amazon EventBridge scheduled rule triggers a Lambda function once per day at a fixed time with no idle compute cost, making it the most cost-effective scheduling solution.
An S3 event notification fires on every individual file upload from each branch, which would invoke the Lambda function multiple times throughout the day rather than once at a specific time after all reports have arrived.
AWS Step Functions incurs state transition charges on top of Lambda invocation costs, adding unnecessary expense for a simple scheduled single-function workflow.
Keeping a Lambda function running continuously is architecturally impossible since Lambda has a maximum execution timeout; continuously polling also wastes invocation time and cost during idle periods.
EventBridge scheduled rules use a cron or rate expression to invoke a Lambda function at a precise time each day. Lambda runs only for the duration of the analysis, and EventBridge rules have no additional cost beyond the Lambda invocation, making this the lowest-cost approach for a once-daily batch job.
Concept tested: EventBridge scheduled rules for once-daily Lambda invocation
Source: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html
Community Discussion
No community discussion yet for this question.