Skip to Content
Asterrr's Handbook
2 · New solutions

Compute and containers

Choosing between EC2, Lambda, ECS, EKS, Fargate and Elastic Beanstalk, plus ECS network modes, Lambda concurrency and VPC access, and edge compute.

Exam tasks: 2.5 (select compute for performance and scale), 4.3 (choose new architectures: serverless, containers)

The decision: how much of the platform do you want to manage (servers, clusters, runtimes), and what does the workload need that only a lower level gives you (long runtimes, GPUs, special kernels, Kubernetes APIs)?

Choosing a platform

yesnonoyesno, need OS controlyesyesnonoyes: GPUs, daemons, hostaccessNew or migrated workloadEvent-driven, short tasks(15 min or less)?LambdaPackaged as containers?Want a managed platformfor a standard web app?ElasticBeanstalkEC2 with AutoScalingKubernetes required(tooling, portability)?EKSECSManage nodes?FargateEC2 capacity
Decision tree for choosing a platform

Side by side

EC2LambdaECS or EKS on FargateECS or EKS on EC2Elastic Beanstalk
You manageOS, patching, scalingCode onlyTask or pod definitionsCluster nodes tooApp code, some config
Max run timeUnlimited15 minutesUnlimitedUnlimitedUnlimited
Scale to zeroNo (ASG can hit 0)YesYes (0 tasks)Tasks yes, nodes via scalingNo
GPUsYesNoNoYesYes, via instance type
PricingPer instance-secondPer request + GB-secondPer vCPU and GB-secondPer instanceUnderlying resources
Best whenLegacy apps, licensing, full controlSpiky, event-driven workContainers without serversDense packing, special hardwareLift a web app with little change

Exam signal

"Least operational overhead" plus containers means Fargate. "Must use existing Kubernetes manifests and Helm charts" means EKS. "Runs for hours" or "needs a GPU" rules out Lambda (and Fargate for GPUs).

Legacy: use Amazon ECS Express Mode instead

AWS App Runner stopped accepting new customers on April 30, 2026. It still runs for existing users, but new designs that want "container image in, HTTPS URL out" use ECS Express Mode, which provisions the ALB, scaling and domain for an ECS service from an image and two IAM roles.

Dedicated service pages

Service discovery and mesh

  • AWS Cloud Map is a registry for service names and endpoints. ECS and EKS services register instances, and clients resolve them through DNS or the DiscoverInstances API. It also gives health-checked results.
  • ECS Service Connect adds a managed proxy and short names for services in the same cluster or namespace, with retries and metrics, and no mesh to run.
  • VPC Lattice connects services across VPCs and accounts with auth policies, and works for EC2, ECS, EKS and Lambda.

Legacy: use ECS Service Connect or VPC Lattice instead

AWS App Mesh reached end of support on September 30, 2026. If a question offers App Mesh for a new design, choose Service Connect for ECS or VPC Lattice instead.

Scenarios

Scenario
A company runs 30 microservices as ECS tasks on EC2 instances in bridge mode. The security team requires that the payments service be the only one allowed to connect to the payments database, but several services share each host. What should the architect change?
Scenario · choose 2
A Lambda-based checkout API has unpredictable cold-start delays during a daily 9am promotion peak, and a batch Lambda function that runs at the same time sometimes uses so much concurrency that checkout requests are throttled. Which TWO actions solve these problems?
Scenario
A streaming service uses CloudFront. It needs to redirect viewers to a country-specific path based on the CloudFront-Viewer-Country header and add security headers to every response, at tens of thousands of requests per second, at the lowest cost. What should it use?

Further reading

On this page