Core Arguments
17 Points1. Sizing is multidimensional
EC2 sizing involves OS, CPU, RAM, storage (EBS/EFS/instance store), network card, firewall rules, and bootstrap scripts — not just instance type.
2. User Data runs once
User Data scripts execute only at first boot with root privileges, automating software installation, updates, and configuration.
3. Instance type naming matters
The convention m5.2xlarge encodes family (m), generation (5), and size (2xlarge) — critical for right-sizing.
4. Security groups are stateful
They contain allow rules only, evaluate all rules before deciding, and are attached at the network interface level. Default: deny inbound, allow outbound.
5. Purchasing is a cost-commitment tradeoff
On-Demand (no commitment), Reserved/Savings Plans (1–3 years, up to 72% off), Spot (up to 90% off, interruptible), Dedicated Host (BYOL).
6. Placement groups control physical layout
Cluster (low latency), Spread (fault tolerance), Partition (large distributed workloads) — each optimizes for a different tradeoff.
7. EBS is persistent, instance store is ephemeral
EBS volumes persist independently of instance lifecycle; instance store data is lost when the instance stops or terminates.
8. Snapshots are incremental backups
EBS snapshots only store changed blocks after the first full snapshot, stored in S3 and used to restore volumes.
9. AMI vs. Snapshot: different scopes
AMIs are templates to launch new instances (include launch permissions, block device mapping); snapshots back up individual volumes.
10. Archive cuts costs by 75%
EBS Snapshot Archive is for rarely accessed snapshots stored 90+ days; retrieval takes 24–72 hours.
11. Recycle Bin is a safety net
Retention rules preserve deleted EBS volumes, snapshots, and AMIs for 1–365 days, preventing accidental data loss.
12. FSR eliminates first-access latency
Fast Snapshot Restore creates fully initialized volumes from snapshots, removing I/O latency on first block access — billed per minute per AZ.
13. Volume types map to workloads
SSD (gp2/gp3/io1/io2) for transactional/random I/O; HDD (st1/sc1) for throughput-intensive or cold data.
14. Encryption is host-level, not volume-level
EBS encryption uses AES-256 and AWS KMS; data is encrypted at rest and in transit between EC2 and EBS.
15. Instance store is high-performance but temporary
Physically attached storage offers lower latency and higher IOPS than EBS, but data does not survive instance stop/termination.
16. EFS is serverless and elastic
Amazon EFS automatically scales to petabytes, supports NFS for Linux, and offers General Purpose (low latency) and Max I/O performance modes.
17. Default security group behavior is permissive outbound
New security groups allow all outbound traffic and deny all inbound; you must explicitly add inbound rules to enable access.
Applicable Methods
8 StepsLaunch an EC2 instance with User Data
Pass a bootstrap script via --user-data to automate first-boot configuration. The script runs as root and executes only once.
Create a Security Group with specific inbound rules
Security groups are stateful; add only the inbound rules you need. Outbound is allowed by default.
Attach an EBS volume to a running instance
Create a volume in the same AZ, then attach it. EBS volumes persist independently of the instance.
Create an EBS snapshot
Snapshots are incremental backups stored in S3. The first snapshot is full; subsequent snapshots only store changed blocks.
Enable Fast Snapshot Restore (FSR)
FSR creates fully initialized volumes instantly. Enable it per snapshot per Availability Zone (up to 5 per Region).
Archive an EBS snapshot for long-term retention
Move rarely accessed snapshots to the Archive tier (90+ days) to reduce storage costs by up to 75%. Retrieval takes 24–72 hours.
Create a Recycle Bin retention rule
Protect against accidental deletion by retaining EBS snapshots and AMIs for 1–365 days.
Mount an Amazon EFS file system on EC2
EFS provides shared, elastic NFS storage for Linux instances. Install the EFS mount helper and mount at boot.
Valuable Quotes
16 Quotes"Security groups act as stateful virtual firewalls attached to EC2 instances at the network interface level."
"User data is a powerful feature for automating the setup of EC2 instances. It runs only once at the instance's first start."
"EBS snapshots are incremental backups, which means that only the blocks on the device that have changed after your most recent snapshot are saved."
"Fast snapshot restore enables you to create a volume from a snapshot that is fully initialized at creation, eliminating I/O latency on first access."
"Amazon EBS Snapshots Archive offers storage costs up to 75% lower for snapshots you plan to store for 90 days or more and rarely need to access."
"Recycle Bin is a data recovery feature that enables you to restore accidentally deleted Amazon EBS snapshots and EBS-backed AMIs."
"The cost of an instance AMI is the storage of all the volumes on the instance, but not the metadata. The cost for an EBS snapshot is the storage of the individual volume."
"Instance store provides temporary block-level storage for your instance. This storage is located on disks that are physically attached to the host computer."
"Amazon EFS provides simple, scalable file storage for use with Amazon EC2 Linux and Mac instances in the AWS Cloud."
"Placement groups allow you to influence the placement of a group of interdependent instances to meet the needs of your workload."
"EBS encryption uses AWS KMS keys to encrypt data at rest inside the volume, data in transit between the volume and the instance, and snapshots."
"General Purpose SSD volumes balance price and performance for a wide variety of transactional workloads."
"Provisioned IOPS SSD volumes are designed for latency-sensitive transactional workloads such as databases."
"Throughput Optimized HDD volumes are ideal for frequently accessed, throughput-intensive workloads such as big data and data warehouses."
"Cold HDD volumes provide low-cost storage for infrequently accessed data where performance is not critical."
"By default, new security groups start with only an outbound rule that allows all traffic to leave the resource. You must add rules to enable any inbound traffic."
Concept Explanations
16 ConceptsEC2 (Elastic Compute Cloud)
Rentable virtual servers in the cloud. You choose OS, CPU, RAM, storage, and networking.
🏠 Like renting an apartment — you pick the size, location, and lease terms, but you don't own the building.
EBS (Elastic Block Store)
Persistent block-level storage volumes for EC2. Survives instance stop/termination independently.
🔌 Like an external hard drive — you can detach it from one computer and attach it to another.
Security Group
Stateful virtual firewall at the instance level. Allow rules only; default deny inbound, allow outbound.
🚪 Like a bouncer at a club — only lets in people on the guest list (allow rules) and remembers who they are.
Placement Group
Controls physical placement of instances: Cluster (low latency), Spread (fault tolerance), Partition (large workloads).
🪑 Like seating arrangements at a wedding — some want to sit together (cluster), some apart (spread).
User Data
Bootstrap script that runs once at first boot with root privileges. Automates software installs and configuration.
📋 Like a checklist you give a new employee on their first day — they follow it once to get set up.
Instance Store
Temporary, physically attached storage with high IOPS and low latency. Data lost on stop/termination.
🧠 Like short-term memory — fast and useful now, but gone when you power off.
Amazon EFS
Serverless, elastic NFS file system for Linux. Scales automatically to petabytes.
📁 Like a shared Google Drive for your EC2 instances — everyone can access the same files.
AMI (Amazon Machine Image)
Template for launching instances. Includes OS, application server, applications, and launch permissions.
🍪 Like a cookie cutter — use it to stamp out identical instances with the same pre-baked configuration.
EBS Snapshot
Incremental backup of an EBS volume stored in S3. Used to restore volumes or create new ones.
📷 Like a photo backup — each new photo only saves what changed from the last one.
Fast Snapshot Restore
Creates fully initialized volumes from snapshots instantly, eliminating first-access I/O latency.
⚡ Like pre-heating an oven — no waiting for it to warm up when you need to bake.
EBS Snapshot Archive
Low-cost storage tier for snapshots kept 90+ days. Up to 75% cheaper; retrieval takes 24–72 hours.
🏚️ Like storing old tax returns in a basement — cheap, but takes time to retrieve when needed.
Recycle Bin
Retention rules that preserve deleted EBS volumes, snapshots, and AMIs for 1–365 days.
🗑️ Like your computer's Recycle Bin — deleted files stay recoverable for a set period.
EBS Volume Types
SSD (gp2/gp3/io1/io2) for transactional; HDD (st1/sc1) for throughput or cold data.
🚗 Like choosing between a sports car (SSD) and a truck (HDD) — each excels at different jobs.
EBS Encryption
AES-256 encryption at the EC2 host level using AWS KMS. Encrypts data at rest and in transit.
🔒 Like a safe that automatically locks itself — you don't manage the lock, it just works.
Purchasing Options
On-Demand, Reserved, Savings Plans, Spot, Dedicated Host/Instance, Capacity Reservation.
🎟️ Like buying tickets — pay full price anytime (On-Demand), or commit early for a discount (Reserved).
Instance Type
Family + generation + size. Families: General Purpose (T/M), Compute (C), Memory (R/X), Storage (I/D).
👕 Like clothing sizes — you pick the fit that matches your workload's needs.