AWS Certified Cloud Practitioner / Question #1427 of 719

Question #1427

A company runs a nightly data processing task that completes within 4 minutes and is executed once per day. The task is currently hosted on-premises, and the company wants to migrate it to AWS while minimizing costs. Which AWS service BEST meets these requirements?

A

Amazon Elastic Container Service (Amazon ECS)

B

AWS Lambda

C

Amazon Elastic Kubernetes Service (Amazon EKS)

D

Amazon EC2

Explanation

AWS Lambda is ideal for short-lived, infrequent tasks due to its serverless nature and pay-per-request pricing. The task runs once daily for 4 minutes, so Lambda charges only for the execution time (rounded to the nearest 100ms) and the number of requests. Other options incur higher costs:
- EC2: Requires paying for a running instance 24/7 (or complex start/stop automation), even when idle.
- ECS/EKS: Container services require provisioning and managing compute resources (e.g., Fargate tasks or EC2 instances), leading to higher costs for sporadic usage.
Lambda eliminates idle costs and operational overhead, making it the most cost-effective solution. Key takeaway: For short-duration, infrequent workloads, serverless services like Lambda minimize costs by charging only when the code runs.

Answer

The correct answer is: B