Across EC2, ECS on Fargate, and AWS Lambda, who is responsible for patching the operating system, and which capacity decisions remain yours in each case?
answer
- three rungs of one abstraction ladder
- who owns the guest operating system
- sizing never fully disappears
- Fargate: no instance to log into
- Lambda decides how many run, you don't
basics
~20 sOn EC2 you patch the guest OS and decide instance count and type. On ECS with Fargate, AWS runs the host and you only size and scale tasks. On Lambda, AWS handles the host and scaling; you set memory and code.
solid answer
~50 sThese three options are rungs on one ladder of abstraction, and the rung decides how much of the machine you are responsible for. With **EC2** you rent a virtual machine: you pick the instance family and size, choose the AMI, patch the guest operating system, and decide how many instances run. With **ECS on Fargate** there is no instance you can log into — AWS owns and patches the host — but you still declare CPU and memory on the task definition and still decide the scaling rules for the service. With **AWS Lambda** you hand over a function; AWS decides how many execution environments exist and patches everything underneath, and your only sizing knob is the memory setting (which also scales the CPU you get). Less control at each rung means less to operate, and fewer places to tune when something is slow.
go deeper
Be ready to place EC2, Fargate and Lambda on a ladder from most to least of the machine you manage, and to say plainly that the guest OS is yours only on EC2.
Explain what stays yours at every rung — container image contents, CPU/memory sizing, scaling policy — and that Lambda's memory setting also determines the CPU it receives.
Show that operational burden is a budget line paid in engineer-hours, and be able to justify keeping EC2 when a workload genuinely needs host access, a GPU, or a licensed agent.
Frame the ladder as an organisational choice: each compute model your company supports needs its own paved road, and the count of supported models is itself a cost you are choosing to carry.
## The question behind the question Interviewers open AWS rounds with this because it separates people who have only used one compute model from people who understand the *shape* of the menu. The three options are not three unrelated products; they are three points on a single axis — how much of the running system AWS operates on your behalf. ## EC2: you rent a virtual machine EC2 gives you a virtual server. You choose an instance family and size, choose an AMI (the disk image the instance boots from), and from that moment on the guest operating system is yours: kernel and package patching, OS-level users, agents, log rotation, host metrics. Capacity is explicit — you decide how many instances run and how big they are, usually by putting them behind an Auto Scaling group so the count follows a metric. What you buy for that work is total control. You can run any process, any protocol, any port, keep data on local disk, install licensed software, use GPUs, and tune the kernel. What you pay is a permanent operational surface: an instance that exists is an instance somebody must patch, monitor and eventually replace. ## ECS on Fargate: you rent a place to run a container Fargate removes the instance from your world. You still build a container image and still declare, in the task definition, how much vCPU and memory each task gets — that part has not disappeared, and candidates who claim "serverless means no capacity decisions" get caught here. What has disappeared is the host: there is no EC2 instance in your account to SSH into, no AMI to bake, no OS to patch. AWS provisions the isolation boundary the task runs in and keeps it current. You still own scaling policy (how many copies of the task should be running), the container image and everything inside it — your base image's packages are still your responsibility, because AWS patches the host, not your image. ## Lambda: you rent execution of a function Lambda is the far rung. You upload code, choose a memory setting, and AWS decides everything else: how many execution environments exist at any moment, where they run, when they are created and destroyed. Concurrency is elastic by default rather than something you provision. Your sizing knob is memory, and CPU is allocated in proportion to it, so "make it faster" and "give it more memory" are the same lever. The price of that is the shape of what you can run. A Lambda function runs in response to an invocation and finishes; it is not a long-lived server you can hold state in or keep a socket open on. ## The shared-responsibility framing AWS describes this as the shared responsibility model: AWS is responsible for the security *of* the cloud, you are responsible for security *in* the cloud — and the boundary between the two moves as you go up the ladder. ```text EC2 Fargate Lambda host hardware AWS AWS AWS hypervisor AWS AWS AWS guest OS / patching YOU AWS AWS runtime YOU YOU (image) AWS application code YOU YOU YOU CPU/memory sizing YOU YOU YOU (memory) how many run YOU YOU (policy) AWS ``` Notice that two rows never move: your code and your data are always yours, and some form of sizing is always yours. Notice also what does move — the guest OS row is the single biggest chunk of routine operational work in most organisations, and it is the row that disappears between EC2 and Fargate. ## Why this matters in a real decision Operational burden is a real cost, paid in engineer-hours rather than on the invoice, and it is one of the axes you weigh when choosing a compute model. A three-person team with no dedicated platform engineers is buying something real when it gives up kernel access. A team that needs a specific kernel module, a GPU, or a licensed agent on the host is buying something equally real by keeping it. Neither answer is universally right — but "who patches this at 3 a.m." belongs in the comparison alongside price.
- If AWS patches the Fargate host, what part of the operating system is still your responsibility?Everything inside your container image. The base image's distribution packages, language runtime and libraries are yours to keep current, and rebuilding and redeploying the image is the only way to patch them. Fargate removes the host OS from your plate, not the userland you shipped.
- Where does EKS sit on this ladder?It sits alongside ECS as a container option with an AWS-managed control plane, and its data plane can itself be EC2 nodes or Fargate — so the same ladder applies one level down. Which orchestrator you pick is a separate decision from how much of the machine you operate.
saying these in an interview costs you the question
- Says Fargate still requires you to patch EC2 instances
- Claims serverless means no capacity or sizing decisions at all
- Thinks you choose an instance type for a Lambda function
- Believes AWS patches the packages inside your container image
- Assumes more control always means lower total cost