Amazon EC2 (Elastic Compute Cloud) is AWS's service that lets you rent virtual servers (called instances) to run your applications, websites, and backend systems ā on-demand and scalable.
ā
Think of EC2 as a cloud-based computer (or server) that you can start, stop, and scale when needed.
š§© Key Features
Feature |
Description |
Elasticity |
Easily scale up/down or in/out based on traffic |
Choice of OS |
Linux, Windows, macOS support |
Various Instance Types |
Choose from compute, memory, storage, or GPU-optimized |
Custom AMIs |
Use or create Amazon Machine Images to replicate setups |
Security Groups |
Acts like a firewall to control traffic |
Integration |
Works with S3, RDS, IAM, VPC, ELB, Auto Scaling, etc. |
Pricing Options |
Pay-as-you-go, Reserved, or Spot Instances |
āļø EC2 Instance Types (Families)
Family |
Optimized For |
Example Use Case |
t4g, t3 |
General purpose |
Web servers, dev/test environments |
m6i, m5 |
Balanced compute & memory |
App servers, small DBs |
c7g, c6g |
Compute optimized |
Gaming servers, batch processing |
r6i, r5 |
Memory optimized |
Large databases, in-memory caching |
p4, g4 |
GPU/Accelerated computing |
Machine learning, rendering, video |
d3, i4 |
Storage optimized |
Big data, log processing, NoSQL |
š How EC2 Works ā Simplified Flow
-
Choose AMI (OS & software stack)
-
Choose Instance Type (hardware config)
-
Configure network, storage, security group
-
Launch Instance ā EC2 is up and running
- Connect via SSH or RDP
- Deploy your app
š¦ Storage Options
Type |
Description |
EBS (Elastic Block Store) |
Persistent block storage (like a hard drive) |
Instance Store |
Temporary storage that is lost on stop/terminate |
EFS |
Shared file storage across multiple instances |
š° Pricing Models
Type |
Description |
EBS (Elastic Block Store) |
Persistent block storage (like a hard drive) |
Instance Store |
Temporary storage that is lost on stop/terminate |
EFS |
Shared file storage across multiple instances |
ā
Use Cases
- Hosting websites or web apps
- Running APIs or backend services
- Game servers, media streaming
- Machine learning training & inference
- Batch jobs or automation scripts
š Security & Monitoring
-
IAM roles for access control
-
Security groups for network rules
-
CloudWatch for monitoring
-
CloudTrail for activity auditing
-
Key pairs for secure SSH/RDP login
ā
Summary
Attribute |
Value |
Service Type |
Compute (Virtual Servers) |
Billing |
Hourly/secondly; various pricing models |
OS Support |
Linux, Windows, macOS |
Scalability |
Manual, Auto Scaling, or Elastic Load Balancing |
Access |
SSH (Linux), RDP (Windows), API, Console |