Chapter 8: Amazon EC2 Intro
Amazon EC2 Intro (Elastic Compute Cloud).
If AWS is the big supermarket of cloud tools (as we said earlier), EC2 is the “fresh produce” section — the virtual servers (computers) you rent to run almost anything: websites, apps, databases, games, AI models, you name it.
This is where beginners get their hands dirty first — launching your own “cloud laptop/server” in minutes. EC2 launched in 2006 as one of AWS’s first services, and it’s still the backbone for millions of workloads in 2026.
Let me teach it step-by-step like we’re in a real lab session — analogies, Hyderabad examples, console walkthrough ideas, and why it’s still super relevant even with serverless options everywhere.
1. What is Amazon EC2? (Simple Definition – 2026 Version)
Amazon Elastic Compute Cloud (EC2) = AWS’s service for secure, resizable virtual servers (called instances) in the cloud.
- “Elastic” = scale up/down instantly (add more power when busy, shrink when quiet).
- “Compute Cloud” = rent CPU, memory, storage, networking over internet.
- You get full control: choose OS (Linux/Windows/macOS), install software, configure like your own physical server — but AWS handles hardware, power, cooling, physical security.
Official short line (from aws.amazon.com/ec2/): “Amazon EC2 provides secure, resizable compute capacity in the cloud, offering the broadest choice of processor, storage, networking, OS, and purchase model.”
In Hyderabad terms: Instead of buying a ₹2–5 lakh Dell/HP server for your college project or startup app → rent a virtual one on EC2 for ₹300–1,000/month (or free in tier), launch in 5 minutes, and delete when done. No UPS worries during power cuts!
2. Core Idea: What is an “EC2 Instance”?
An EC2 instance = your virtual server/machine in AWS.
When you launch one:
- Pick instance type (hardware specs: how much CPU/RAM/disk/network).
- Pick AMI (Amazon Machine Image) — pre-made template with OS + software (like Ubuntu, Amazon Linux, Windows Server, or custom with your app).
- Pick Region/AZ (e.g., ap-south-2 Hyderabad for low latency).
- Add storage (EBS volume like SSD), networking (VPC, security group firewall), key pair (SSH login).
- Launch → in seconds, you get a running server with public IP!
You connect via:
- SSH (Linux) — ssh -i key.pem ec2-user@public-ip
- RDP (Windows) — remote desktop
- Or browser-based: EC2 Instance Connect / Session Manager (no public IP needed — super secure).
Example analogy: Think of EC2 like renting a bike on Bounce or Yulu:
- Choose type: normal, electric, gearless.
- Pick location (near you).
- Pay per minute/hour.
- Ride (use), return (terminate) when done.
3. Why Use EC2? (Key Benefits – Real 2026 Wins)
- Full control — Root/admin access, install anything (unlike Lambda serverless).
- Scalable — Auto Scaling Groups add/remove instances based on CPU/traffic.
- Flexible pricing — Free tier t3.micro, On-Demand, Spot (up to 90% off), Reserved/Savings Plans.
- Huge variety — Over 1,000+ instance types in 2026 (Intel, AMD, AWS Graviton ARM, NVIDIA GPUs, Mac for iOS dev).
- High availability — Spread across AZs, 99.99% SLA.
- Still king for many workloads — Databases, web apps, ML training, gaming servers, legacy Windows apps — even in AI era.
Hyderabad example: A startup in Madhapur builds a Telugu news app:
- Runs backend (Node.js/Python) on EC2 t4g.medium (Graviton — cheap & efficient).
- Scales to 10 instances during elections.
- Costs ~₹1,500–4,000/month vs buying physical servers.
4. Instance Types – The Heart of EC2 (2026 Overview)
Instance types = families grouped by purpose (pick based on workload).
Main categories (with latest 2026 examples):
| Category | Best For | Popular Families (2026) | Example Use in Hyderabad |
|---|---|---|---|
| General Purpose | Balanced (web, apps, dev) | M8g/M8i (Graviton/Intel), T4g/T3 (burstable), Mac (for iOS) | College websites, small APIs |
| Compute Optimized | High CPU (batch, gaming, analytics) | C8g/C8i (Graviton/Intel), C8id (with SSD) | Video encoding, simulations |
| Memory Optimized | High RAM (databases, caches) | R8g/R8i, X8g, U7i (ultra-high mem) | Redis, big data processing |
| Storage Optimized | High I/O (NoSQL, data warehousing) | I8g/I7i (NVMe SSDs) | Kafka, big logs |
| Accelerated | GPU/FPGA/ML/HPC | G6/G7 (NVIDIA), P5/P6 (for training), Trn2 (Trainium) | AI model training, rendering |
| HPC Optimized | Supercomputing | Hpc8a (AMD Turin) | Research simulations |
Free tier favorite: t3.micro / t4g.micro — 2 vCPU burstable, 1 GB RAM — free 750 hours/month first year.
New in 2026 highlights: M8azn (AMD EPYC 5GHz turbo), C8id/R8id (Intel Granite Rapids + huge SSD), more Graviton for 30–40% better price/performance.
5. Pricing Models (How You Pay – Very Important!)
- On-Demand — Pay per second (min 60s) — no commitment (~₹0.01–few ₹/hour).
- Spot — Bid on spare capacity — up to 90% off — great for non-urgent jobs (can be interrupted).
- Reserved Instances / Savings Plans — Commit 1–3 years — 40–70% savings.
- Dedicated Hosts — Your own physical server for licenses/compliance.
Tip for beginners: Start On-Demand in free tier — set billing alarm at ₹500!
6. Mini Hands-On: Launch Your First EC2 (Do This Today – Free!)
- Log in to console.aws.amazon.com → search “EC2” → “Launch instance”.
- Name: “MyFirstHyderabadEC2”.
- AMI: Amazon Linux 2023 or Ubuntu (free tier eligible).
- Instance type: t3.micro (free).
- Key pair: Create new → download .pem file (save safely!).
- Network: Default VPC, enable public IP.
- Security group: Allow SSH (port 22) from your IP.
- Launch!
- Wait 2–3 min → connect via SSH (use PuTTY/Terminal).
- Run sudo yum update or sudo apt update — you’re inside your cloud server!
Terminate when done (right-click → Instance state → Terminate) — stops billing.
Cost? Usually ₹0 first year.
Quick Summary Table – EC2 Intro Cheat Sheet
| Question | Answer (Beginner) |
|---|---|
| What is EC2? | Virtual servers you rent & control in AWS cloud |
| What is an instance? | One virtual machine (your “cloud computer”) |
| Free tier? | t3/t4g.micro — 750 hrs/month for 12 months |
| Best first type? | t3.micro or t4g.micro (cheap, burstable) |
| Connect how? | SSH (Linux), RDP (Windows), browser Session Manager |
| Scale how? | Auto Scaling Groups |
| Still relevant 2026? | Yes — for control, legacy, complex apps, ML training |
EC2 is your first big “I built something in cloud” moment — everything else (RDS, Lambda, ECS) often connects to it.
Ready for next?
- Step-by-step launch with screenshots in mind?
- Deep dive on instance types/families?
- Or EC2 vs Lambda (when to choose what)?
Tell me — next practical class starts now! 🚀🖥️
