- EC2 provides resizable virtual servers (instances) in AWS Cloud — launch as many as needed, configure OS, network, storage, security. Enables rapid deploy without upfront hardware.
- Choose instance types (varying CPU, memory, network, GPU/storage) to optimize for workload.
- Uses AMIs (Amazon Machine Images) as templates to spin up instances quickly.
EC2 is foundational and tightly integrates across the AWS ecosystem:
- EBS for persistent block storage (survives shutdown, supports snapshots, up to 16 TB).
- S3 for object storage; EC2 can access S3 with free in-region bandwidth.
- Auto Scaling for dynamic instance scaling to match load.
- Elastic Load Balancing (ELB) to distribute traffic across instances.
- CloudWatch for monitoring metrics (CPU, network, via agent memory/disk).
- IAM roles, VPC, Security Groups, and Key Management Service (KMS) handle access, isolation, encryption.
- Web/application hosting with customizable environment.
- Big data processing, analytics, machine learning workloads.
- Legacy or specialized workloads requiring full OS-level control.
- Flexible scaling for batch jobs, simulations, seasonal traffic surges.
- AWS Lambda (serverless) – ideal for event-driven, short tasks; less control than EC2.
- Elastic Beanstalk – PaaS for app deployment; abstracts infrastructure management.
- AWS Fargate / ECS / EKS – for container workloads without managing servers.
- Lightsail – simplified bundles for small/simple projects.
When not to use EC2: for short-lived, stateless, autoscaling workloads where serverless or managed platform services (Lambda, Fargate, Beanstalk) provide easier, cost-efficient solutions.
- Instance quotas per region: default vCPU-based or instance-based limits. Accounts typically start with ~20 On-Demand instances total; request increases via Service Quotas.
- Monitoring startup time: EC2 scaling (booting VMs) takes minutes — less suitable for ultra-low-latency autoscaling.
- Spot instances are cost-effective (up to 90% off) but can be interrupted with ~2-minute warning.
- Certain high-frequency use require understanding of limits and quotas to avoid deployment failures.
- Rapid microservices and event-based workloads that benefit from Lambda’s zero-server management.
- Simple web apps where Lightsail or Elastic Beanstalk simplify provisioning.
- Container orchestration where Fargate/EKS/ECS offload server infrastructure concerns.
| Topic | Key Points |
|---|---|
| Definition | Virtual server service for flexible, controlled compute. |
| Integration | Works with EBS, S3, ELB, Auto Scaling, CloudWatch, IAM, VPC. |
| Use Cases | Web apps, batch jobs, analytics, legacy systems. |
| Similar Services | Lambda, Elastic Beanstalk, Fargate/EKS, Lightsail. |
| Limits | vCPU/instance quotas, scaling latency, spot disruptions. |
| When Not to Use | Serverless/event-driven apps, simple projects, container-managed workloads. |
- Understand when control matters — EC2 wins when you need OS-level customization.
- Know pricing models – On-Demand, Reserved, Spot (cost vs. reliability trade-offs).
- Be clear on integration patterns – e.g. ELB + Auto Scaling for HA; EBS vs. instance store.
- Recognize limits and how to request increases.
- Spot instances are exam common — best for fault-tolerant jobs, not for critical servers.

