Amazon EC2: The Backbone of AWS Compute

Amazon Elastic Compute Cloud (EC2) provides resizable compute capacity in the cloud. It reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity up and down as your computing requirements change.

The Real-World Analogy

Think of Amazon EC2 as renting a vehicle. Instead of buying a fleet of trucks (On-premises servers), you rent them from a massive global agency (AWS).

  • On-Demand: Renting a car by the hour for a quick trip.
  • Reserved: Signing a long-term lease for a lower monthly rate.
  • Spot: Bidding on “standby” vehicles that the agency can take back if they need them, but at a 90% discount.

1. Purchasing Options (Exam Favorite)

Choosing the right pricing model is critical for the SAA-C03 exam, specifically for “Cost Optimization” questions.

Option Best For… Cost Saving
On-Demand Short-term, unpredictable workloads; application development. 0% (Baseline)
Reserved Instances (RI) Steady-state usage (1 or 3-year commitment). Standard vs. Convertible. Up to 75%
Savings Plans Flexible usage across EC2, Lambda, and Fargate. Commitment to $/hour. Up to 72%
Spot Instances Fault-tolerant, flexible, or stateless workloads (Batch jobs, CI/CD). Up to 90%
Dedicated Hosts Strict compliance or complex per-core software licensing (BYOL). Expensive

2. Instance Types & Storage

EC2 instances are grouped into families optimized for different tasks:

  • General Purpose (T, M): Balanced CPU, Memory, and Networking.
  • Compute Optimized (C): High-performance processors (Batch processing, Gaming servers).
  • Memory Optimized (R, X, High Mem): Fast performance for large datasets in memory (SAP, In-memory DBs).
  • Storage Optimized (I, D, H): High, sequential read/write for local storage (NoSQL, Data warehousing).

Storage: EBS vs. Instance Store

  • EBS (Elastic Block Store): Network-attached, persistent, survives instance termination, supports snapshots.
  • Instance Store: Physically attached to the host. Ephemeral (data lost if instance stops or fails). High IOPS, low latency.

3. Placement Groups

How instances are physically placed on the underlying hardware:

  • Cluster: Low-latency, high-throughput in a single AZ. (Best for HPC).
  • Spread: Each instance on distinct hardware (Max 7 per AZ). (Best for critical individual instances).
  • Partition: Instances in one partition do not share hardware with other partitions. (Best for Hadoop, Cassandra, Kafka).

Exam Tips and Gotchas

  • The 169.254.169.254 IP: This is the link-local address used to retrieve Instance Metadata (tags, IP, instance ID). It is NOT for user data (scripts).
  • Termination Protection: This is turned OFF by default. If enabled, you cannot terminate via API/Console until it’s disabled.
  • Spot Termination: AWS gives a 2-minute warning via CloudWatch Events before reclaiming a Spot instance.
  • EBS Multi-Attach: Only available on specific volume types (io1/io2) and allows multiple instances to attach to one volume in the same AZ.
  • Hibernate: To hibernate, the root volume must be EBS, encrypted, and have enough space for RAM content.

Decision Matrix: If / Then Guide

  • If you need to run a script at the first boot → Use EC2 User Data.
  • If you need the lowest latency between instances → Use Cluster Placement Group.
  • If you need to keep data even if the instance is deleted → Use EBS (Disable DeleteOnTermination).
  • If you need to run legacy software with specific hardware IDs → Use Dedicated Host.
  • If the workload is “stateless” and you want to save the most money → Use Spot Instances.

Topics covered:

Summary of key subtopics covered in this guide:

  • EC2 Purchasing Models (On-Demand, RI, Spot, Savings Plans)
  • Instance Families (General, Compute, Memory, Storage)
  • Storage options (EBS vs. Instance Store)
  • Placement Groups (Cluster, Spread, Partition)
  • Security Groups and Networking basics
  • Metadata vs. User Data
  • High Availability and Cost Optimization strategies

EC2 Ecosystem Infographic

VPC (Virtual Private Cloud) EC2 Instance IAM Role EBS (Disk)
Security

Access & Identity

Security Groups: Statefull firewalls. Rules allow traffic; default is deny all. No “Deny” rules.

Key Pairs: SSH (Linux) or RDP (Windows) access. AWS stores public key; you keep private.

Performance

Scaling & Network

ENI: Logical networking component. Can be moved between instances.

ENA: Enhanced Networking for up to 100 Gbps speeds.

Use Case

Production Pattern

Web Tier: Use T3/M5 instances in an Auto Scaling Group across multiple AZs behind an Application Load Balancer.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top