In one sentence
Choose EC2 for host control, Lambda for short event-driven functions, and Fargate for serverless container tasks.
Key points
- EC2 gives operating-system control and supports long-running or specialized workloads, but requires instance management.
- Lambda automatically scales short functions and bills by invocation and duration, with a 15-minute maximum.
- Fargate runs containers without managing servers but still needs ECS or EKS orchestration.
Exam takeaway
Decide by deployment unit, runtime duration, host control, scaling pattern, and operational responsibility.