Amazon EC2 and Its Features
Amazon EC2 is AWS’s most important service: virtual servers you rent by the second. The best way to understand it is to take a traditional server room and find the EC2 feature that replaces each part. By the end, every screen of “Launch instance” will make sense.
In this session
- EC2 in one line
- Traditional IT → EC2: the 11-part map
- Instances, AMIs and instance types (live decoder)
- EBS vs instance store
- Key pairs, security groups, tags and Elastic IPs
- Pricing: On-Demand, Savings Plans, Spot
- Hands-on: spot each feature while launching
01What is Amazon EC2?
| Word | Meaning |
|---|---|
| Elastic | stretches and shrinks: add servers when busy, remove them when quiet |
| Compute | processing power (CPU, RAM) to run your apps |
| Cloud | delivered over the internet, pay-as-you-go |
Like renting a car. Pick a model (small hatchback or big SUV), use it as long as you need, return it, and pay only for the time you used it.
02Traditional IT → EC2: the map
| Traditional IT | EC2 feature | What it does |
|---|---|---|
| Physical server | Instance | the virtual server itself |
| OS & software | AMI | template with the OS and software |
| Server hardware (CPU, RAM) | Instance type | the hardware size, e.g. t3.micro |
| Hard disks | EBS volume | permanent network disk |
| Built-in scratch disk | Instance store | fast temporary disk, wiped on stop |
| Username / password | Key pair | public key on AWS, private key with you |
| Firewall | Security group | which ports and IPs may connect |
| Office LAN | VPC | your private network |
| Server room | Region & AZ | where it physically runs |
| Stickers / labels | Tags | Name=web-01, Env=prod |
| Public IP from the ISP | Elastic IP | fixed public address |
03Instances, AMIs and instance types
Instance lifecycle: launch → pending → running ⇄ stopped → terminated. Stop = like shutting down (disk kept, no compute charge, disk still billed). Terminate = deleted forever. Linux is billed per second (minimum 60 seconds).
| AMI source | Examples |
|---|---|
| AWS-provided | Amazon Linux 2023, Ubuntu, Red Hat, Windows Server |
| AWS Marketplace | ready images from vendors (WordPress, firewalls), sometimes paid |
| Community | shared by others: check carefully |
| My AMIs | make your own from a configured instance, then launch identical copies |
The instance type sets CPU, memory, storage, network and GPU. Decode any name here:
| Family | Optimised for | Example use |
|---|---|---|
| T, M general purpose | balanced | websites, small apps |
| C compute | CPU | batch jobs, gaming, video encoding |
| R, X memory | RAM | big databases, caches |
| I, D storage | fast local disk | NoSQL, data warehouses |
| P, G, Inf, Trn accelerated | GPUs / AI chips | machine learning, graphics |
04EBS vs instance store
| EBS type | Kind | Use |
|---|---|---|
| gp3 | general purpose SSD | default for most workloads |
| io2 | provisioned IOPS SSD | critical databases |
| st1 | throughput HDD | big sequential data, logs |
| sc1 | cold HDD | rarely used data, lowest cost |
05Key pairs, security groups, tags and Elastic IPs
| Security group rule | Port | Source |
|---|---|---|
| SSH (admin login, Linux) | 22 | My IP only, e.g. 49.36.10.5/32 |
| HTTP (website) | 80 | 0.0.0.0/0 (anyone) |
| HTTPS (secure website) | 443 | 0.0.0.0/0 |
| Outbound: all traffic | all | 0.0.0.0/0 (default) |
- Security groups have allow rules only: no “deny”.
- Default: all inbound blocked, all outbound allowed.
- Stateful: if a request is allowed in, its reply is allowed out automatically.
- Tags are labels like
Name=web-01,Env=prod; used for search, cost tracking and access control. - Elastic IP = a fixed public IPv4 address; release it when unused (it is charged).
06How you pay for EC2
| Option | Discount | Best for |
|---|---|---|
| On-Demand | none | short, unpredictable work, testing |
| Savings Plans | up to ~72% | steady use with a 1- or 3-year commitment |
| Reserved Instances | up to ~72% | steady use of one instance type |
| Spot Instances | up to ~90% | jobs that can be interrupted (batch, CI, big data) |
| Dedicated Hosts | premium | licensing or compliance needing your own hardware |
- Data must survive stop/start → EBS. Fastest temporary disk → instance store.
- Interruptible batch → Spot. Steady 24×7 → Savings Plans / RIs.
- Launch many identical servers → custom AMI. Fixed public IP → Elastic IP.
07Summary
- EC2 = virtual servers on demand; an instance is one server.
- Pick an AMI (OS), instance type (hardware), EBS or instance store (disk), key pair (login), security group (firewall), VPC/AZ (network, location), tags (labels), Elastic IP (fixed IP).
- Instance names: family + generation + attributes + size (m7g.large).
- Pay with On-Demand, Savings Plans/RIs (up to ~72% off) or Spot (up to ~90% off).
08Quick quiz
1. Which EC2 feature replaces “OS & software”?
2. In c7g.xlarge, “g” means…
3. Data must survive a stop/start. Use…
4. Can a security group have a deny rule?
5. Cheapest for interruptible batch jobs?