EBS vs instance store
EBS (Elastic Block Store) is network-attached block storage that persists independently of the instance — you can stop the instance, detach the volume, snapshot it to S3, and reattach it. Instance store is physically-attached local disk: very fast, but EPHEMERAL — its data is lost when the instance stops or terminates. Use EBS for anything that must survive (boot volumes, databases); use instance store only for scratch/cache data you can rebuild.
- EBS = network block storage, persistent, snapshot to S3, detach/reattach
- Instance store = fast local disk, EPHEMERAL (lost on stop/terminate)
- EBS for durable data; instance store for scratch/cache
Exam tip: EBS persists and snapshots to S3; instance store is ephemeral. Stopping an instance keeps EBS data but loses instance-store data.
Source: AWS docs — EC2 User Guide
Security groups, key pairs, IAM role, user data & metadata
An instance is secured by a security group (its stateful firewall), an optional key pair for SSH/RDP access, and an IAM role (via the instance profile) for calling AWS APIs without stored keys. User data is a script run at first boot to configure the instance. The instance metadata service (IMDS) exposes instance details and the role's temporary credentials to code on the instance — use IMDSv2 (session-oriented) to reduce SSRF risk, and never bake long-lived keys into the AMI or user data.
- Security group = firewall; key pair = SSH/RDP; IAM role = API access without keys
- User data configures the instance at first boot
- Metadata (IMDS) serves the role's temporary credentials; prefer IMDSv2
Exam tip: Code on an instance reads temporary role credentials from the metadata service — no keys needed. Use IMDSv2.
Source: AWS docs — EC2 User Guide
Purchasing options & cost
EC2 pricing models trade commitment for savings: On-Demand for flexibility, Reserved Instances / Savings Plans for steady workloads committed over 1–3 years, and Spot for fault-tolerant, interruptible workloads at large discounts. Right-sizing and Auto Scaling further cut cost by matching capacity to demand. Choosing the model to fit the workload's predictability is a classic cost-optimization decision.
- On-Demand (flexible), Reserved/Savings Plans (committed), Spot (interruptible)
- Match the model to workload predictability
- Right-size + Auto Scale to avoid paying for idle capacity
Exam tip: Steady & predictable → Reserved/Savings Plans; spiky/flexible → On-Demand; fault-tolerant & interruptible → Spot.
Source: AWS docs — EC2 User Guide
Auto Scaling, load balancing & health checks
An Auto Scaling group (ASG) launches and terminates instances across multiple AZs to match demand, using a launch template. It registers instances with a load balancer's target group; the ELB health check removes unhealthy targets and the ASG replaces failed instances (self-healing). Scaling policies react to metrics — target tracking (keep CPU ~50%), step scaling, or scheduled scaling for known peaks. Together, ELB + ASG give elasticity AND availability with little operational effort.
- ASG spans AZs, launches from a template, self-heals failed instances
- ELB health checks route only to healthy targets; ASG replaces failures
- Scaling policies: target tracking, step, scheduled
Exam tip: Auto Scaling provides both elasticity AND self-healing (replacing unhealthy instances); an ELB alone does neither.
Source: AWS docs — EC2 Auto Scaling
Comparison: EBS vs instance store, Spot vs On-Demand, vertical vs horizontal
EBS vs instance store: EBS persists and snapshots to S3; instance store is fast but ephemeral. Spot vs On-Demand: Spot is far cheaper but interruptible (fault-tolerant work only); On-Demand is reliable at full price. Vertical vs horizontal scaling: vertical means a bigger instance (simple, but a ceiling and a single point of failure); horizontal means more instances across AZs (scales further, survives failures, needs stateless design). The exam favors persistent storage, interruption-aware Spot use, and horizontal scaling.
- EBS persistent vs instance store ephemeral
- Spot cheap/interruptible vs On-Demand reliable/full-price
- Vertical (bigger, capped, SPOF) vs horizontal (more, elastic, resilient)
Source: AWS docs — EC2 User Guide