All exams← All AWS Solutions Architect Associate (SAA-C03) notes

Compute & container design (EC2, Lambda, ECS): AWS Solutions Architect Associate (SAA-C03) revision notes

Revision notes

EC2 instance types and purchasing

EC2 gives you full control over the OS. Choose instance families by workload: T (burstable, general-purpose, cheap), M (balanced), C (compute-optimised, high CPU), R (memory-optimised), I/D (storage-optimised). Purchasing options matter for cost questions: On-Demand for unpredictable short-term work, Reserved/Savings Plans (1 or 3 year, up to ~72% off) for steady-state predictable workloads, Spot Instances (up to 90% off) for fault-tolerant flexible workloads that can handle interruption with a 2-minute warning, and Dedicated Hosts for licensing/compliance needs where you must control the physical server.

Auto Scaling and Elastic Load Balancing

Auto Scaling Groups (ASGs) keep the right number of EC2 instances running using a launch template, min/max/desired capacity, and scaling policies (target tracking is the recommended default, e.g. keep average CPU at 50%). ASGs work across multiple Availability Zones for resilience. Elastic Load Balancers spread traffic: Application Load Balancer (ALB) works at Layer 7 for HTTP/HTTPS and supports path/host-based routing, Network Load Balancer (NLB) works at Layer 4 for extreme performance and static IPs, Gateway Load Balancer is for third-party virtual appliances.

Lambda essentials

Lambda is serverless compute, billed per millisecond of execution and memory used, with no servers to patch. Key numbers to memorise: default timeout is 3 seconds, maximum timeout is 15 minutes, memory is configurable from 128 MB to 10,240 MB, and CPU scales automatically with memory. Deployment package size limits: 50 MB zipped direct upload, 250 MB unzipped including layers, or up to 10 GB using container images. Concurrency: default account concurrent execution limit is 1,000 (soft limit, raisable), and Provisioned Concurrency removes cold starts for latency-sensitive apps. Lambda is ideal for short, event-driven, stateless tasks triggered by S3, API Gateway, DynamoDB Streams, EventBridge, or SQS.

ECS and container choices

ECS (Elastic Container Service) runs Docker containers using Task Definitions (the blueprint: image, CPU, memory, ports) and Services (which keep a desired number of tasks running, often behind an ALB). Two launch types: EC2 launch type means you manage the underlying EC2 instances yourself (more control, more admin); Fargate is serverless — AWS manages the infrastructure, you just define CPU/memory per task. EKS is AWS's managed Kubernetes alternative for teams already standardised on Kubernetes tooling.

Common exam traps

  • Don't pick Lambda for anything needing more than 15 minutes runtime or heavy persistent state — use ECS/EC2 instead.
  • Spot Instances can be terminated with only 2 minutes' notice — never use for stateful, non-interruptible jobs.
  • Fargate removes server management entirely; EC2 launch type is chosen only when you need OS-level control or GPU/specialised instances.
  • Target tracking scaling policies are simpler and usually the better answer than step scaling unless the question specifies complex thresholds.

Key facts

Practice questions

Compute & container design (EC2, Lambda, ECS): 5 practice questions

Q1. An EC2 instance in a public subnet needs to allow inbound HTTPS traffic from anywhere on the internet, while denying all other unsolicited inbound traffic. Which resource should be configured to allow inbound TCP port 443 from 0.0.0.0/0?
  • A.  An IAM policy attached to the instance role
  • B.  The VPC's main route table
  • C.  A security group attached to the instance
  • D.  The subnet's route table
Show answer & explanation
✓ Answer: C. A security group attached to the instance
A security group acts as a stateful virtual firewall at the instance (ENI) level; adding an inbound rule allowing TCP 443 from 0.0.0.0/0 permits HTTPS traffic while all other inbound traffic is denied by default. Route tables control traffic routing between subnets and gateways, not port-level access control.
Q2. A Solutions Architect is asked to justify why AWS Fargate is described as 'serverless' even though containers ultimately run on physical servers somewhere. What is the MOST accurate explanation?
  • A.  Fargate tasks run entirely within the customer's own on-premises data center
  • B.  Serverless means there is no cost associated with running the workload
  • C.  'Serverless' means the customer does not provision, patch, or manage the underlying servers; AWS handles that infrastructure layer transparently
  • D.  Fargate genuinely runs without any physical servers anywhere in AWS's infrastructure
Show answer & explanation
✓ Answer: C. 'Serverless' means the customer does not provision, patch, or manage the underlying servers; AWS handles that infrastructure layer transparently
'Serverless' in AWS's context means the customer is abstracted away from provisioning, patching, and managing the underlying servers, not that servers cease to physically exist; AWS operates and manages that infrastructure layer on the customer's behalf. Fargate workloads are still billed based on vCPU and memory allocated for the duration tasks run.
Q3. A company wants to reduce the blast radius of a compromised EC2 instance by ensuring it can only communicate with a specific RDS database on port 3306 and nothing else outbound. Which approach is MOST appropriate?
  • A.  Disable the VPC's internet gateway entirely
  • B.  Use a Network ACL as the only control, with no security group changes
  • C.  Configure the instance's security group to restrict outbound rules to only the RDS security group on port 3306
  • D.  Rely solely on the default allow-all outbound security group rule
Show answer & explanation
✓ Answer: C. Configure the instance's security group to restrict outbound rules to only the RDS security group on port 3306
Security groups can have outbound rules restricted to specific destinations, such as allowing only the RDS instance's security group on port 3306, which tightly scopes what a compromised instance can reach. The default security group behaviour allows all outbound traffic, which does not limit blast radius.
Q4. A company needs to run a stateful legacy Windows application on EC2 that requires a specific CPU architecture and cannot be containerized in the short term. Which EC2 purchasing option offers the LOWEST cost for a workload guaranteed to run continuously for the next 3 years?
  • A.  Spot Instances
  • B.  On-Demand Instances
  • C.  Standard Reserved Instances with a 3-year term, All Upfront payment
  • D.  Fargate Spot
Show answer & explanation
✓ Answer: C. Standard Reserved Instances with a 3-year term, All Upfront payment
For a workload with guaranteed continuous usage over a known long term, a 3-year Standard Reserved Instance with All Upfront payment provides the deepest discount compared to On-Demand, since AWS rewards longer commitment and upfront payment. Spot Instances are unsuitable because they can be interrupted, and Fargate does not apply to EC2-hosted, non-containerized legacy applications.
Q5. A Solutions Architect is choosing between Amazon EKS and Amazon ECS for a new containerized workload. Which statement accurately distinguishes the two?
  • A.  ECS is only for stateless applications, while EKS supports stateful applications exclusively
  • B.  ECS is AWS's proprietary container orchestration service, while EKS is a managed Kubernetes service; both can run on EC2 or Fargate
  • C.  EKS can only run on Fargate, and ECS can only run on EC2
  • D.  EKS does not support Fargate as a compute option
Show answer & explanation
✓ Answer: B. ECS is AWS's proprietary container orchestration service, while EKS is a managed Kubernetes service; both can run on EC2 or Fargate
ECS is AWS's own container orchestration service with a simpler, proprietary API, while EKS is a managed control plane for standard Kubernetes; both support running workloads on either EC2 instances or the serverless Fargate launch type. Neither service is restricted to only stateless or only stateful applications.
Test yourself
See the AWS Solutions Architect Associate (SAA-C03) page

More AWS Solutions Architect Associate (SAA-C03) topics