🖥️ EC2 Index

AWS Elastic Compute Cloud (EC2) provides scalable computing capacity in the AWS cloud. This section covers everything from basic instances to advanced load balancing and auto scaling configurations.

Overview

EC2 allows you to launch virtual servers (instances) in the cloud with complete control over computing resources. You can scale capacity up or down based on demand, paying only for what you use.

Core Concepts

Instance Fundamentals

  • 1 EC2 Overview - EC2 basics, Elastic IPs, and SSH connectivity
  • 2 Instance Types - Understanding EC2 instance families and use cases
  • 5 AMI - Amazon Machine Images for instance templates

Networking

Purchasing and Cost Optimization

Storage

Configuration and Automation

High Availability and Scaling

Hands-On

Learning Path

Follow this sequence for optimal understanding:

  1. Basics: 1 EC2 Overview - Understand EC2 fundamentals
  2. Instance Types: 2 Instance Types - Choose the right instance
  3. Networking: 3 EC2 IP Addresses and 4 Elastic Network Interface
  4. Images: 5 AMI - Create and use custom images
  5. Cost: 6 EC2 Purchasing Options and 7 Spot Instances
  6. Storage: 9 EBS and EFS Storage - Persistent storage options
  7. Automation: 10 User Data and Bootstrap - Automate setup
  8. Scaling: 11 Auto Scaling Groups - Handle variable load
  9. Load Balancing: 12 Application Load Balancer and 13 Network Load Balancer
  10. Practice: 15 Lab Resources - Hands-on experience

Key Concepts

Instance Types

  • General Purpose - Balanced compute, memory, and networking
  • Compute Optimized - High-performance processors
  • Memory Optimized - Fast performance for memory-intensive workloads
  • Storage Optimized - High sequential read/write access
  • Accelerated Computing - GPU instances for ML and graphics

Purchasing Options

  • On-Demand - Pay by the hour/second, no commitment
  • Reserved Instances - 1 or 3-year commitment for cost savings
  • Spot Instances - Bid on spare capacity for up to 90% savings
  • Dedicated Hosts - Physical servers for compliance requirements

Load Balancing

  • Application Load Balancer (ALB) - HTTP/HTTPS traffic, Layer 7
  • Network Load Balancer (NLB) - TCP/UDP traffic, Layer 4, ultra-low latency
  • Target Groups - Register instances, containers, or IP addresses

Storage Options

  • EBS (Elastic Block Store) - Persistent block storage
  • EFS (Elastic File System) - Managed NFS file system
  • Instance Store - Temporary block storage (ephemeral)

Best Practices

Security

  • Use Security Groups to control inbound/outbound traffic
  • Use IAM roles instead of storing credentials on instances
  • Keep instances in private subnets when possible
  • Use Systems Manager Session Manager instead of SSH when possible

Cost Optimization

  • Right-size instances based on actual usage
  • Use Spot Instances for fault-tolerant workloads
  • Purchase Reserved Instances for steady-state workloads
  • Stop instances when not in use (dev/test environments)

High Availability

  • Deploy across multiple Availability Zones
  • Use Auto Scaling Groups for automatic recovery
  • Use Elastic Load Balancers for traffic distribution
  • Regular AMI backups for disaster recovery

Performance

  • Choose appropriate instance types for workload
  • Use enhanced networking when available
  • Place instances close to data sources
  • Use placement groups for low-latency requirements

Prerequisites

Next Steps

  • ECS - Container orchestration on EC2
  • Kubernetes - Container orchestration
  • Linux - System administration

Advanced Topics

Common Use Cases

  1. Web Applications - Host websites and web applications
  2. Batch Processing - Run large-scale batch jobs
  3. Development/Testing - Create isolated development environments
  4. High-Performance Computing - Scientific simulations and modeling
  5. Machine Learning - Train and deploy ML models
  6. Gaming Servers - Host multiplayer game servers

Troubleshooting

Common Issues

  • Cannot connect via SSH - Check Security Group rules for port 22
  • Instance not accessible - Verify VPC, subnet, and route table configuration
  • High costs - Review instance types and consider Reserved/Spot instances
  • Performance issues - Monitor CloudWatch metrics and right-size instances

Back to Main Index

← Back to AWS Notes Index