Training / Certifications / AWS Cloud Practitioner / Containers and Serverless Compute

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.

Domain 3: Cloud Technology and Services (34%)Task 3.3About 5:57CaptionsStatic view for reduced motion
Lesson 17: Containers and Serverless Compute Illustrative example: names and values are samples 1. ContainersWhat a container image isAmazon ECR: store the imagesAmazon ECS or Amazon EKS?Run on EC2 or on AWS Fargate2. Serverless functionsAWS Lambda: code runs on eventsPay per request and durationPlus: Elastic Beanstalk,Lightsail and AWS BatchDomain 3, Task 3.3: Identify AWS compute servicesVirtual machinesHardwareHypervisorGuest OSApp+ librariesGuest OSApp+ librariesGuest OSApp+ librariesContainersHardwareOne host OS + container runtimeApp+ libsApp+ libsApp+ libsApp+ libslighter: no guest OS eachA container image packs the app and everything it needs.It runs the same on a laptop, a test server or AWSDeveloper buildsimage store-web:v3Amazon ECRprivate image registrystore-web:v1store-web:v2store-web:v3pushpullAmazon ECSor Amazon EKSruns v3Amazon ECR: fully managed registry to store, manage and deploy images.IAM controls access; you pay for storage and data transferAn orchestrator:• Places containers on capacity• Keeps the right number running• Replaces failed containers• Rolls out new versionsAmazon ECSAWS's own container orchestratorTasks and services, simple to startDeep integration with AWS servicesGood default for new AWS appsAmazon EKSManaged Kubernetes (open source)AWS runs the Kubernetes control planeUse existing Kubernetes tools, skillsPortable: same model on-premisesThe question says “Kubernetes”? The answer is Amazon EKS.Otherwise, “run containers on AWS” usually means Amazon ECSOn EC2 instancesyou manage the serversPick instance types, patch the OSScale the cluster's instancesOn AWS Fargateserverless compute for containersSet CPU and memory per task or podAWS runs, patches and scales serversFargate isn't a third orchestrator: it runs your ECS tasks or EKS pods.You pay for the vCPU and memory they use, per secondPhoto uploadedto Amazon S3Thumbnail savedShopper request viaAmazon API GatewayOrder JSON returnedSchedule: everynight (EventBridge)Sales report sentAWS Lambdaλyour code, as a functionno servers to manageServerless doesn't mean no servers: AWS manages them for you.Lambda runs your code only when an event arrives, and scales with itYou pay forRequests: each time it's invokedDuration: run time in ms, pricedby the memory you choose$No events?No requests, no duration:nothing runs, nothing billedBuilt for short, stateless tasksMemory: 128 MB to 10,240 MB(more memory also means more CPU)Longest single run (timeout):015 min30 minbeforenowRaised from 15 to 30 minutesin November 2026Hours-long or always-on work? Use containers, AWS Batch or EC2.Lambda fits event-driven tasks that finish in minutesElastic BeanstalkPaaS for web appsUpload your code; it setsup EC2, load balancing,Auto Scaling, health checksAmazon Lightsailsimplest virtual serversA bundle: vCPU, memory,SSD and data transfer ata low, predictable priceAWS Batchbatch jobs at any scaleQueue many jobs; it picksand scales the compute(EC2 or Fargate) for youBeanstalk: deploy a web app without wiring it up yourself.Lightsail: simple server, predictable price. Batch: many jobsMore controlLess to manageAmazon EC2You manage:OS, patches,scaling, appECS / EKS on EC2You manage:cluster instances,containersAWS FargateYou manage:containers only(CPU, memory)AWS LambdaYou manage:your code only(and memory)The store:pages in containers on Fargate, thumbnails in Lambda, reports in AWS BatchServerless on the exam = AWS Lambda and AWS Fargate.Pick the option with the least to manage that still fits the jobIf the question says……think“Package an app with its dependencies”Containers“Store and manage container images”Amazon ECR“Kubernetes”, “managed control plane”Amazon EKS“Containers without managing servers”AWS Fargate“Run code in response to events”AWS Lambda“Upload code; AWS handles capacity”Elastic Beanstalk“Simple server, predictable price”Amazon LightsailContainersImage = app + dependenciesAmazon ECR stores the imagesECS: AWS's orchestratorEKS: managed KubernetesRun on EC2 or on FargateServerless and moreLambda: code runs on eventsPay per request + durationUp to 30 minutes per runBeanstalk: PaaS; Lightsail: VPSAWS Batch: batch jobsFrom most to least to manage: EC2, ECS or EKS on EC2,Fargate, Lambda. Pick the least that still fits the job

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 imagesAmazon ECR
Run Kubernetes on AWS with a managed control planeAmazon EKS
Run containers without provisioning or managing EC2 instancesAWS Fargate
Run code when a file is uploaded; pay only while it runsAWS Lambda
Developers upload code and AWS handles provisioning, load balancing and scalingAWS Elastic Beanstalk
A simple virtual private server with a predictable monthly priceAmazon 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?

  1. Amazon ECS
  2. AWS Lambda
  3. Amazon EKS
  4. 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?

  1. AWS Lambda
  2. Amazon EC2 with Auto Scaling
  3. Amazon Lightsail
  4. 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?

  1. Amazon ECR
  2. Amazon EKS with self-managed EC2 nodes
  3. Amazon Lightsail
  4. 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?

  1. AWS Batch
  2. AWS Elastic Beanstalk
  3. Amazon ECR
  4. AWS Lambda
  5. 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.)

  1. AWS Lambda
  2. Amazon EC2 Dedicated Hosts
  3. AWS Fargate
  4. Amazon Lightsail instances
  5. 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.

Download captions (WebVTT)

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.

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.

← Lesson 16Amazon EC2, Auto Scaling and Load Balancing
Lesson 18Arrives

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.