A finance office validates uploaded budget files only once each night for a few minutes. Why prefer AWS Lambda over always-on EC2 for that job?
Select an answer to reveal the explanation.
Short Explanation
A few minutes once a night is the poster child for Lambda—run, finish, stop paying for idle iron. Always-on EC2 would sit around bored most of the day. EC2 can do schedules, but Lambda is the better fit for short intermittent work.
Full Explanation
A finance office that validates uploaded budget files only once each night for a few minutes should prefer AWS Lambda over always-on EC2 because Lambda fits intermittent scheduled or event-driven workloads without paying for idle servers. A scheduled EventBridge rule can invoke the validator nightly; billing follows invocations and duration rather than a 24×7 instance. That economics and operations model matches short municipal batch checks.
Lambda is not required for every continuous multi-day HPC simulation—those often need EC2, Batch, or HPC-oriented architectures. It is false that EC2 cannot run scheduled tasks; EC2 can, but keeping an instance idle all day for a few minutes of work is usually wasteful. Lambda also does not permanently store multi-terabyte databases inside the function package; durable data belongs in databases or S3.
Exam caveat: Short, infrequent, event/schedule-driven work → Lambda. Long-running, specialized, or persistent servers → EC2/containers. Watch for “only a few minutes / once each night” cues.
Operational check: package the validator, grant S3 read permissions via the function role, schedule with EventBridge, set timeouts and memory based on file sizes, emit success/failure metrics, and alert finance IT if the nightly run misses its window before morning budget meetings.