AWS Cloud Practitioner (CLF-C02) · Lesson 17 of 26
Containers and Serverless Compute
Explain what a container is, recognize when to use Amazon ECS, Amazon EKS, Amazon ECR and AWS Fargate, describe how AWS Lambda runs and bills event-driven code, and identify the purpose of AWS Elastic Beanstalk, Amazon Lightsail and AWS Batch.
Tip: turn your phone sideways or use full screen for larger labels.
Captions match the narration word for word. Press Space to play or pause and the arrow keys to change scenes.
Learning objective
Explain what a container is, recognize when to use Amazon ECS, Amazon EKS, Amazon ECR and AWS Fargate, describe how AWS Lambda runs and bills event-driven code, and identify the purpose of AWS Elastic Beanstalk, Amazon Lightsail and AWS Batch.
Exam mapping
Domain 3: Cloud Technology and Services (34%). Task statement 3.3 in the official exam guide.
Key takeaways
- A container image packages an application with its libraries and settings; containers share the host operating system, so they're lighter than virtual machines and run the same in every environment.
- Amazon ECR is a fully managed, private container registry to store, manage and deploy container images, with IAM controlling access; Amazon ECS, Amazon EKS and AWS Lambda can pull images from it.
- Amazon ECS is AWS's own container orchestrator; Amazon EKS is managed Kubernetes, where AWS runs a highly available Kubernetes control plane and you keep standard Kubernetes tools.
- Containers run either on EC2 instances you manage or on AWS Fargate, serverless compute for containers that works with ECS and EKS (and AWS Batch); you set CPU and memory and pay for what your tasks or pods use.
- AWS Lambda runs code in response to events (S3 uploads, API Gateway requests, EventBridge schedules and more) without servers to manage; you pay for requests and duration (priced by memory), and a single run can last up to 30 minutes (raised from 15 minutes in November 2026).
- AWS Elastic Beanstalk deploys web apps and handles capacity, load balancing, Auto Scaling and health monitoring; Amazon Lightsail offers simple virtual servers at a low, predictable price; AWS Batch runs batch computing jobs and provisions the compute for them.
Exam tips
How the exam asks about this
Questions describe a situation and expect you to recognize the concept behind it.
| If the question mentions… | Think |
|---|---|
| Store, manage and deploy Docker or container images | Amazon ECR |
| Run Kubernetes on AWS with a managed control plane | Amazon EKS |
| Run containers without provisioning or managing EC2 instances | AWS Fargate |
| Run code when a file is uploaded; pay only while it runs | AWS Lambda |
| Developers upload code and AWS handles provisioning, load balancing and scaling | AWS Elastic Beanstalk |
| A simple virtual private server with a predictable monthly price | Amazon Lightsail |
Common traps
- AWS Fargate is serverless compute for containers, not a function service and not an orchestrator: you still use Amazon ECS or Amazon EKS to run tasks or pods on it.
- Amazon ECR only stores images; it doesn't run containers. Running them is the job of ECS or EKS (on EC2 or Fargate).
- “Serverless” doesn't mean no servers exist: AWS manages them. On the exam, the serverless compute options are AWS Lambda and AWS Fargate, not EC2 or Lightsail.
- Lambda's maximum run time is now 30 minutes (it was 15 minutes until November 2026, and older questions may still use 15). Work that runs for hours or must stay always on fits containers, AWS Batch or EC2 better.
Practice
Exam-style questions
Answer each one before you open the explanation.
Question 1. A company already runs its containerized applications on Kubernetes in its data center. It wants to move them to AWS, keep its Kubernetes tools, and have AWS manage the control plane. Which service should it use?
- Amazon ECS
- AWS Lambda
- Amazon EKS
- AWS Elastic Beanstalk
Show answer
C. Amazon EKS. Amazon EKS is managed Kubernetes: AWS runs the Kubernetes control plane, and teams keep using standard Kubernetes tools. Amazon ECS is tempting because it also orchestrates containers, but it's AWS's own orchestrator, not Kubernetes, so the existing tools and configuration wouldn't carry over. Lambda runs functions, and Elastic Beanstalk deploys web apps.
Question 2. An online store wants to create a thumbnail every time a customer uploads a product photo to Amazon S3. It doesn't want to manage servers and wants to pay only when the code runs. Which service fits best?
- AWS Lambda
- Amazon EC2 with Auto Scaling
- Amazon Lightsail
- Amazon ECS on EC2 instances
Show answer
A. AWS Lambda. AWS Lambda runs code in response to events such as an S3 upload and bills only for requests and duration, with no servers to manage. EC2 with Auto Scaling is tempting because it scales with demand, but you still manage instances and pay while they run, even with no uploads. Lightsail and ECS on EC2 also mean running servers.
Question 3. A team wants to run containerized microservices with Amazon ECS but doesn't want to provision, patch or scale any EC2 instances. Which AWS service should it use to run the containers?
- Amazon ECR
- Amazon EKS with self-managed EC2 nodes
- Amazon Lightsail
- AWS Fargate
Show answer
D. AWS Fargate. AWS Fargate is serverless compute for containers: you set CPU and memory per task, and AWS runs and patches the servers underneath. Amazon ECR is tempting because it's a container service, but it only stores images; it doesn't run them. EKS with self-managed nodes still means managing EC2 instances, and Lightsail is a simple server, not container compute for ECS.
Question 4. A developer wants to deploy a Java web application by uploading the code, and have AWS automatically handle capacity provisioning, load balancing, Auto Scaling and health monitoring. Which service should the developer use?
- AWS Batch
- AWS Elastic Beanstalk
- Amazon ECR
- AWS Lambda
- Amazon Lightsail
Show answer
B. AWS Elastic Beanstalk. Elastic Beanstalk takes uploaded application code and handles deployment details such as capacity provisioning, load balancing, Auto Scaling and health monitoring. Lightsail is tempting because it's also simple, but it gives you a virtual server bundle to set up yourself; it doesn't deploy and scale the app for you. Batch runs batch jobs, ECR stores images, and Lambda runs event-driven functions.
Question 5. Which TWO AWS services are serverless compute options, where AWS manages the underlying servers? (Select TWO.)
- AWS Lambda
- Amazon EC2 Dedicated Hosts
- AWS Fargate
- Amazon Lightsail instances
- Amazon ECR
Show answer
A. AWS Lambda and C. AWS Fargate. AWS Lambda runs functions and AWS Fargate runs containers, and in both AWS provisions, patches and scales the servers. Lightsail is tempting because it's simple and fixed-price, but you still get and manage a virtual server. EC2 Dedicated Hosts are physical servers you manage, and Amazon ECR is a registry for storing images, not compute.
Transcript
Lesson transcript
The full narration, scene by scene. The captions file contains the same text with timings.
Scene 1 · 0:00
Lesson 17: containers and serverless. Last time we sized EC2 instances and scaled them. Today we let AWS take on more of the work. Two ideas. First, containers: what a container image is, where you store it with Amazon ECR, and how Amazon ECS, Amazon EKS and AWS Fargate run it. Second, serverless functions with AWS Lambda. We'll finish with three quick extras the exam likes: Elastic Beanstalk, Lightsail and AWS Batch. This is still Task 3.3, compute.
Scene 2 · 0:32
What a container is. A virtual machine carries a full guest operating system for every app. A container is lighter. It packs the app with its libraries and settings into an image, and many containers share one host operating system through a container runtime. That makes containers small and quick to start. And because the image holds everything the app needs, it runs the same way on a developer's laptop, a test server or AWS.
Scene 3 · 1:03
Amazon ECR stores the images. Our store's developer builds a new image of the website: store-web, version three. Where does it live? In Amazon Elastic Container Registry, or ECR: a fully managed, private registry to store, manage and deploy container images. The developer pushes the image to ECR, and the services that run containers pull it from there. IAM controls who can push and pull. There's nothing to run yourself: you pay for the image data you store and transfer.
Scene 4 · 1:35
Amazon ECS or Amazon EKS?. Running one container is easy. Running hundreds needs an orchestrator: it places containers, keeps the right number running, replaces failed ones and rolls out new versions. AWS offers two. Amazon ECS, Elastic Container Service, is AWS's own orchestrator: simple to start and tightly integrated with AWS. Amazon EKS, Elastic Kubernetes Service, is managed Kubernetes, the open-source standard. AWS runs the Kubernetes control plane, and teams keep their existing Kubernetes tools.
Scene 5 · 2:06
Run containers on EC2 or on Fargate. Both orchestrators need compute to run on. Option one: EC2 instances in your cluster. You pick the instance types, patch them and scale them. Option two: AWS Fargate, serverless compute for containers. You set the CPU and memory for each task or pod, and AWS runs, patches and scales the servers underneath. You pay for the vCPU and memory your containers use. Note that Fargate isn't a third orchestrator: it runs your ECS tasks or EKS pods.
Scene 6 · 2:39
AWS Lambda: code that runs on events. Now our second idea: serverless functions. Serverless doesn't mean there are no servers. It means AWS manages them. With AWS Lambda, you upload code as a function and connect it to a trigger. A shopper's photo lands in Amazon S3, and a function saves a thumbnail. A request arrives through Amazon API Gateway, and a function returns the order. A nightly schedule runs a sales report. Lambda runs only when an event arrives, and scales automatically with the number of events.
Scene 7 · 3:14
Lambda pricing and limits. Lambda pricing has two parts: the number of requests, and the duration, measured in milliseconds and priced by the memory you choose. No events means nothing runs and nothing is billed. You can give a function from 128 MB to 10,240 MB of memory, and more memory also brings more CPU. Lambda is built for short, stateless tasks. In November 2026 AWS raised the longest single run from 15 to 30 minutes, so older practice questions may still say 15.
Scene 8 · 3:49
Elastic Beanstalk, Lightsail and AWS Batch. Three more compute services to recognize. AWS Elastic Beanstalk is platform as a service for web apps: you upload your code, and it handles capacity, load balancing, Auto Scaling and health monitoring. Amazon Lightsail is the simplest way to get a virtual server: a bundle of vCPU, memory, SSD storage and data transfer at a low, predictable price. And AWS Batch runs batch jobs, choosing and scaling the compute for you.
Scene 9 · 4:20
How much do you want to manage?. Put the options on one line. With EC2 you manage the operating system, patches and scaling. With ECS or EKS on EC2, you still manage the cluster's instances. With Fargate, you manage only your containers. With Lambda, only your code. Our store could mix them: product pages in containers on Fargate, thumbnails in Lambda, and big nightly reports in AWS Batch. On the exam, the serverless compute options are Lambda and Fargate.
Scene 10 · 4:51
How the exam asks about this. Here's how the exam asks about this. Package an app with its dependencies so it runs anywhere: containers. Store and manage container images: Amazon ECR. Anything that mentions Kubernetes: Amazon EKS. Run containers without managing servers: AWS Fargate. Run code in response to events, paying only when it runs: AWS Lambda. Upload code and let AWS handle capacity and scaling: Elastic Beanstalk. A simple server at a predictable monthly price: Amazon Lightsail.
Scene 11 · 5:22
Recap: containers and serverless. To recap: a container image packs an app with its dependencies, and Amazon ECR stores the images. Amazon ECS is AWS's orchestrator, and Amazon EKS is managed Kubernetes. Both run on EC2 instances or on serverless AWS Fargate. AWS Lambda runs code on events, billed by requests and duration, for up to 30 minutes per run. Beanstalk deploys web apps, Lightsail gives simple servers, and Batch runs batch jobs. Next, we move to storage: Amazon S3 and its storage classes.
Sources and accuracy
Checked against AWS documentation and the official CLF-C02 exam guide on October 18, 2026. AWS changes often, so confirm details in the current documentation. Diagrams and numbers in the animation are illustrative.
- Choosing an AWS container service (decision guide)
- What is AWS Lambda?
- Lambda quotas
- AWS Elastic Beanstalk FAQs
- CLF-C02 exam guide: Domain 3, Cloud Technology and Services
This free course is independent and isn't affiliated with or endorsed by Amazon Web Services. AWS and AWS Certified Cloud Practitioner are trademarks of Amazon.com, Inc. or its affiliates.
Preparing a team for AWS certification?
I run hands-on AWS training for teams, from Cloud Practitioner basics to architecture, built around your own environment.