EC2 Exam Notes
1. Overview of Amazon EC2
- Definition:
EC2 (Elastic Compute Cloud) is AWS’s Infrastructure as a Service (IaaS) offering that gives you scalable virtual servers in the cloud. - Key Benefits:
- On-demand scalability
- Flexible configurations
- Integration with other AWS services
2. EC2 Instance Types
AWS categorizes instances based on the workload they best support:
-
General Purpose:
- Usage: Versatile for tasks like hosting web servers or code repositories
- Example: An M5 instance can handle balanced CPU, memory, and networking needs.
-
Compute Optimized:
- Usage: Ideal for compute-intensive tasks that require high-performance processors
- Example: A C5 instance is great for batch processing and high-performance web servers.
-
Memory Optimized:
- Usage: Best for workloads processing large data sets in memory (e.g., in‑memory databases)
- Example: R5 or R6 instances are tailored for memory-bound applications.
-
Storage Optimized:
- Usage: Designed for tasks requiring high, sequential read/write access to local storage
- Example: I3 instances are used for high-performance storage tasks.
Note: Some exam questions might also reference Accelerated Computing (e.g., GPU instances) even though they aren’t listed in your notes.
3. Security Groups
- Concept:
Security groups act as a virtual firewall controlling traffic to and from your EC2 instances. - Default Behavior:
- Inbound: All traffic blocked by default
- Outbound: All traffic allowed by default
- Characteristics:
- They contain only allow rules (no deny rules).
- A single security group can be attached to multiple instances within the same AWS Region/VPC.
Example:
When configuring a web server, you might add an allow rule for HTTP (port 80) and HTTPS (port 443) while leaving all other inbound traffic blocked.
4. EC2 Purchasing Options
AWS offers several pricing models to match various workload requirements:
-
On-Demand Instances:
- Characteristics:
- No long-term commitment
- Highest cost per hour
- Best for:
- Short-term, unpredictable, or uninterruptible workloads
- Characteristics:
-
Reserved Instances:
- Reservation Period: 1 year or 3 years
- Payment Options:
- No Upfront
- Partial Upfront
- All Upfront
- Best for:
- Steady-state workloads that run continuously
- Convertible Reserved Instances:
- Allow you to change the instance type during the reservation period
-
Savings Plans:
- Overview:
- Commit to a certain usage (1 or 3 years) to get a discount
- Best for:
- Organizations with predictable, long-term usage
- Overview:
-
Spot Instances:
- Characteristics:
- Most cost-efficient (up to 90% discount)
- Can be interrupted by AWS with little notice
- Best for:
- Distributed, flexible workloads that are fault-tolerant
- Characteristics:
-
Dedicated Hosts:
- Overview:
- A physical server dedicated solely to your use
- Supports strict compliance requirements and complex software licenses
- Cost:
- The most expensive option
- Overview:
-
Dedicated Instances:
- Overview:
- Run on hardware dedicated to your account but might share that hardware with other instances from your account
- Overview:
-
Capacity Reservations:
- Purpose:
- Guarantee access to EC2 capacity when you need it
- Best for:
- Short-term, uninterrupted workloads
- Purpose: