AWS Certified Solutions Architect – Associate (SAA-C02) — Question 300
A solutions architect is creating a data processing job that runs once daily and can take up to 2 hours to complete. If the job is interrupted, it has to restart from the beginning.
How should the solutions architect address this issue in the MOST cost-effective manner?
Answer options
- A. Create a script that runs locally on an Amazon EC2 Reserved Instance that is triggered by a cron job.
- B. Create an AWS Lambda function triggered by an Amazon EventBridge (Amazon CloudWatch Events) scheduled event.
- C. Use an Amazon Elastic Container Service (Amazon ECS) Fargate task triggered by an Amazon EventBridge (Amazon CloudWatch Events) scheduled event.
- D. Use an Amazon Elastic Container Service (Amazon ECS) task running on Amazon EC2 triggered by an Amazon EventBridge (Amazon CloudWatch Events) scheduled event.
Correct answer: C
Explanation
AWS Fargate is the most cost-effective choice because it charges only for the exact vCPU and memory resources consumed during the 2 hours the task is active, with no idle infrastructure costs. AWS Lambda is not viable because it has a strict 15-minute execution limit. Using EC2 Reserved Instances or running an ECS task on EC2 instances would incur continuous charges for idle compute resources, which is not cost-optimal for a job that only runs once a day.