Special notes: Reserved Instances billed through term even if terminated; RI term continues per schedule
EBS-backed instances support stop/start lifecycle; other instance types may differ
EC2 Pricing Models
On-Demand: pay per hour or per second (depending on instance type); flexible; suitable for unpredictable workloads; non-interruptible
Reserved Instances and Savings Plans: substantial discounts for predictable, steady-state usage; term options typically 1-3 years; unused capacity may be resold in some cases
Spot Instances: deep discounts (up to ~90% off); instances can be interrupted with little notice; suitable for fault-tolerant, flexible workloads
Dedicated Instances/Servers: physical tenancy isolation; higher cost; for regulatory or compliance requirements
Summary concept: choose a pricing model based on workload predictability and tolerance for interruption
EC2 Auto Scaling
Purpose: ensure the correct number of EC2 instances are available to handle load
Mechanism: collections of instances organized into Auto Scaling Groups (ASGs)
Types of scaling:
Vertical Scaling (Scale-up/Scale-down): adjust capacity of existing instances
Horizontal Scaling (Scale-out/Scale-in): add or remove instances
Benefits/Features:
Health monitoring and replacement of unhealthy instances
Load balancing across Availability Zones (AZs)
Support for multiple instance types and purchase options
Automatic replacement of Spot Instances
Integration with Load Balancers
Scalability and Instance Refresh
Limits: Vertical scaling adds resources to one machine; Horizontal scaling adds more machines
Coverage: ensures minimum capacity in ASG; can scale based on metrics (noted generally in practice)
Elastic Load Balancing (ELB)
Purpose: distribute inbound network traffic across a group of backend servers to improve scalability and availability
How it works: health checks on registered targets; avoids routing traffic to unhealthy targets
Types of Load Balancers:
Classic Load Balancer: traditional, layer 4/5 and some layer 7 support; limited routing features
Application Load Balancer (ALB): HTTP/HTTPS layer 7 routing; supports path-based and host-based routing; dynamic port mapping
Network Load Balancer (NLB): TCP/SSL layer 4 routing; high throughput, millions of requests per second
Gateway Load Balancer: deploys virtual appliances; transparent gateway with distribution
Integration: can work with ASGs, Lambda, ECS/EKS, and other AWS services
AWS Compute Services Overview (context for other services)
Data remains within the region; bucket and object paths determine access
Common S3 Use Cases
Storing application assets (static web hosting)
Backups and disaster recovery
Staging area for big data
Archival data and machine learning datasets
Amazon S3 Pricing (Summary)
Pay for what you use: per GB-month, data transfer (OUT to other regions), and requests (PUT, COPY, POST, LIST, GET)
Not charged for: in-transfers within AWS services in same region (IN to S3, OUT to CloudFront/EC2 in same region)
Pricing examples depend on class and region
Amazon S3 vs EBS vs EFS: Quick Comparison
EBS (Elastic Block Store): block storage for EC2; max per volume: up to 16 TiB; data lives in a single AZ; high IOPS/throughput options with gp3/io2/sc1/st1 families
EFS (Elastic File System): scalable, fully managed file storage; accessible from multiple EC2 instances concurrently; shared NFS file system; distributed across AZs; high throughput and low latency; POSIX-compliant
S3 (Simple Storage Service): object storage; unlimited storage; region-based durability and availability; best for unstructured data, backups, media, data lakes
Cleanup mental model: choose block storage for databases and OS disks (EBS), shared file storage for multi-EC2 workloads (EFS), and object storage for large-scale, durable data with varied access patterns (S3)
Elastic Block Store (EBS) – Deep Dive
EBS provides persistent block storage volumes for EC2 instances
Key features:
Block-level storage with persistent volumes
Volumes are replicated within an Availability Zone for durability
Snapshots can back up volumes to S3 automatically
Use cases: boot volumes, data storage for EC2, databases, enterprise apps
Volume types:
Solid State Drives (SSD)
General Purpose (gp3, io2) – fast I/O; suitable for most workloads
Hard Disk Drives (HDD)
Throughput-Optimized (st1)
Cold (sc1)
Volume characteristics (typical values shown in the slides):