AWS Certified Cloud Practitioner / Question #837 of 719

Question #837

A company needs to execute a weekly data analysis batch job that requires approximately 5 hours to finish. Which AWS service is most suitable for this workload?

A

AWS Lambda

B

Amazon EC2

C

AWS CloudFormation

D

AWS Outposts

Explanation

The correct answer is B (Amazon EC2).

Why EC2?
- Long-Running Jobs: EC2 instances can run continuously for hours or days, making them ideal for a 5-hour batch job. AWS Lambda has a 15-minute execution timeout, which disqualifies it.
- Flexibility: EC2 allows full control over the compute environment, including OS, storage, and software configurations required for data analysis.
- Cost Optimization: EC2 can be stopped after the job completes, minimizing costs. Spot Instances or Reserved Instances can further reduce expenses.

Why Not Other Options?
- A (Lambda): Lambda's 15-minute runtime limit makes it unsuitable for 5-hour jobs.
- C (CloudFormation): CloudFormation is an infrastructure-as-code tool for provisioning resources, not a compute service.
- D (Outposts): Outposts extends AWS infrastructure to on-premises data centers, which is unnecessary here.

Key Points:
- Lambda is event-driven and short-lived; EC2 handles long-running tasks.
- Batch jobs requiring >15 minutes typically use EC2, AWS Batch, or ECS.
- CloudFormation and Outposts address infrastructure management, not compute execution.

Answer

The correct answer is: B