EC2 (Elastic Compute Cloud) is AWS's service for renting virtual servers in the cloud.

In simple terms: You get a Linux or Windows server running on AWS infrastructure that you can access over the internet.

Common Use Cases:

EC2 provides scalable virtual servers in the cloud with pay-as-you-go pricing.


EC2 Key Features

Feature Description
Elastic Scale up or down anytime based on demand
Pay-as-you-go Pay only for the time the instance is running
Secure Key-based login, firewall via Security Groups
Scalable Go from 1 to thousands of servers as needed

EC2 Launch Flow

1. Login to AWS Console
         |
2. Navigate to EC2 → Launch Instance
         |
3. Select AMI (e.g., Ubuntu 22.04)
         |
4. Select Instance Type (e.g., t2.micro)
         |
5. Configure Security Group (open required ports)
         |
6. Create or select Key Pair
         |
7. Launch Instance
         |
8. Connect via SSH using .pem key

Core EC2 Concepts


1. AMI (Amazon Machine Image)

An AMI is a pre-built template that contains: