EC2 Basics
Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the AWS Cloud. It eliminates the need to invest in hardware up front, so you can develop and deploy applications faster.

- AMI (Amazon Machine Image):
- A template that contains the software configuration (OS, application server, and applications) required to launch your instance.
- Region Scoped: AMIs are locked to a specific region. To use an AMI in another region, you must copy it.
- Public vs. Private: You can create your own AMIs and choose to keep them private or share them publicly.
- User Data:
- Script used to run commands when an instance first launches.
- Used to bootstrap instances (e.g., install updates, install software, download files from S3).
- Runs with
rootprivileges.
- Instance Metadata:
- Data about your instance (e.g., private IP, public IP, hostname, IAM role name).
- Accessible from within the instance via URL:
http://169.254.169.254/latest/meta-data/Important (Exam Tip)
Do not confuse User Data (boot script) with Metadata (instance info).
EC2 Instance Type Basics
Understanding instance families is crucial for selecting the right resource for a workload.

Amazon EC2 instance type naming conventions
Naming convention: e.g., m5.2xlarge
m: Instance Class (Family)
5: Generation (Higher is newer)
2xlarge: Size (CPU/RAM capacity)
Key Instance Families (Mnemonic: “Fight DR MC. P.X.”)
| Family Code | Type | Use Case |
|---|---|---|
| G, P, Tr, Inf | Accelerated Computing | Graphics, Graphics Processing, Floating Point Number calculations, Machine Learning, AI |
| I, D, H | Storage Optimized | High IOPS, Data Warehousing, Distributed File Systems. I instances are great for databases needing high I/O (NoSQL) |
| M | General Purpose | Balanced Compute/Memory/Networking. Good for application servers, gaming servers, small DBs. |
| C | Compute Optimized | High performance processors. Batch processing, media transcoding, scientific modeling, dedicated gaming servers. |
| R, X, Z | Memory Optimized | High RAM. In memory databases (Redis, Memcached), Real-time processing of big data (Apache Spark). |
| T | Burstable | General purpose but with the ability to “burst” CPU. Uses CPU credits. Good for workloads with idle time (e.g., dev environments) |
Important (Exam Tip)
If the scenario mentions “High Performance Computing (HPC)” or “Batch Processing”, think C family.
If it mentions “In-memory database” or “Cache”, think R family.
Security Group & Classic Ports Overview
A Security Group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic.