EC2
Elastic Compute Cloud
ELI5 — The Vibe Check
EC2 is AWS's way of renting you a virtual computer in the cloud. You pick how powerful it is, what OS it runs, and pay by the hour. It's just a Linux (or Windows) machine you SSH into — except it lives in Amazon's data center. The backbone of most AWS-hosted apps.
Real Talk
Amazon EC2 provides resizable virtual machines in the cloud. You choose instance type (CPU, RAM, GPU), AMI (OS image), storage, and networking. Instances are billed per second. EC2 supports auto scaling, spot instances (discounted), and reserved instances for cost optimization.
Show Me The Code
# Launch an EC2 instance via CLI
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \
--instance-type t3.micro \
--key-name my-key-pair \
--security-groups my-sg
# SSH into the instance
ssh -i my-key.pem ec2-user@ec2-12-34-56-78.compute.amazonaws.com
When You'll Hear This
"The app runs on a t3.medium EC2 instance." / "EC2 spot instances are 70% cheaper if you can handle interruptions."
Related Terms
Auto Scaling
Auto scaling is when the cloud automatically adds more servers when traffic spikes and removes them when it drops, so you're not paying for idle machines a...
AWS (Amazon Web Services)
AWS is like a giant magical warehouse where you can rent computers, storage, databases, and basically anything tech-related — by the minute.
ECS (Elastic Container Service)
ECS is AWS's system for running Docker containers at scale.
Fargate
Fargate is AWS's 'serverless containers' magic. You run Docker containers without ever seeing or touching an EC2 server. AWS figures out where to run them.
IaaS (Infrastructure as a Service)
IaaS is when you rent the raw computer hardware in someone else's data center.
Security Group
A security group is a firewall for your cloud resources. You write rules like 'allow port 443 from anywhere' or 'allow port 5432 only from the app servers.