EC2 stands for Elastic Compute Cloud is a service from Amazon Web Services (AWS). EC2 is an on-demand computing service on the AWS cloud platform called instances. It lets you rent virtual computers to run your applications. You pay only for what you use.
The name itself explains its core value:
- Elastic: You can easily increase or decrease the number of instances or their size as your needs change.
- Compute: It provides the processing power, memory, and storage for your workloads.
- Cloud: It runs on AWS's massive, global data center infrastructure.
The Core Components of an EC2 Instance
Before launching an instance, you need to understand its five fundamental building blocks.
1. Amazon Machine Image (AMI)
- Provides thousands of AMIs from AWS, the community, and AWS Marketplace
- Allows users to create custom AMIs for reuse and consistency
- Acts as a software blueprint containing the operating system, patches, and required software
2. Instance Types
Instance types are the hardware profiles of your virtual server. AWS offers a vast array of instance types optimized for different tasks, grouped into families:
- t family (e.g., t2.micro, t3.large): General Purpose, burstable instances. Perfect for web servers, development environments, and small databases.
- m family (e.g., m5.xlarge): General Purpose, balanced instances with a good mix of CPU, memory, and networking.
- c family (e.g., c5.large): Compute Optimized, with a high ratio of CPU power to memory. Ideal for CPU-intensive tasks like batch processing, media transcoding, and scientific modeling.
- r family (e.g., r5.large): Memory Optimized, with a high ratio of memory to CPU. Used for memory-intensive applications like large databases or in-memory caches.
3. Elastic Block Store (EBS) Volumes
- Provides durable, block-level storage attached to EC2 instances
- Acts as a virtual hard drive for storing data
- Persists data independently and can be detached and reattached to different instances
4. Security Groups
A Security Group acts as a virtual firewall for your EC2 instance, controlling all inbound and outbound traffic. You define rules that specify which protocols (e.g., SSH, HTTP), ports (e.g., 22, 80), and IP address ranges are allowed to send traffic to or receive traffic from your instance.
5. Key Pairs
A Key Pair, consisting of a public key and a private key, is the set of security credentials used to prove your identity when connecting to a Linux EC2 instance. AWS stores the public key, and you are responsible for securely storing the private key file (.pem). You will use this private key to SSH into your instance.
Amazon EC2 (Elastic Compute Cloud) Linux Instances
Step 1: First login into your AWS account. Once you are directed to the management console. From the left click on "Services" and from the listed options click on EC2.
Step 2:Â Afterward, you will be redirected to the EC2 console. Here is the image attached to refer to various features in EC2.

Working of AWS EC2
Instead of buying and managing your own servers, EC2 gives you a virtual machine, where you can run websites, apps, or even big data tasks.
- Choose the memory, storage, and CPU you need, and stop the instance when done.
- EC2 offers secure, reliable, high-performance, and cost-effective infrastructure.
- Deploy applications without managing physical hardware.
- Secure your instance using VPC, Subnets, and Security Groups.
- Attach Auto Scaling to scale EC2 based on demand.
- Automatically scale up or down based on traffic.
The following figure shows the EC2-Instance which is deployed in VPC (Virtual Private Cloud).

Features of AWS EC2 (Elastic Compute Cloud)
The following are the features of AWS EC2:
1. AWS EC2 Functionality
- Provides a virtual computing platform to run operations, launch instances, and fully customize the environment
- Enhances security and allows configuration changes at any time
- Offers default AMIs and supports custom AMIs to reuse preferred configurations without reconfiguration
2. AWS EC2 Operating Systems
- Provides a wide selection of operating systems when choosing an AMI
- Allows users to upload and use their own operating systems
- Offers commonly preferred operating systems directly in the EC2 console

- Amazon Linux
- Windows Server
- Ubuntu Server
- SUSE Linux
- Red Hat Linux
3. AWS EC2 Software
- Leads the cloud computing market with diverse EC2 options
- Allows users to choose from a wide range of software for EC2 instances
- Provides access to software like SAP, LAMP, and Drupal through AWS Marketplace
4. AWS EC2 Scalability and Reliability
- Handles dynamic traffic scenarios efficiently
- Provides reliable performance through flexible volumes and snapshots
- Allows scaling up or down based on changing workload requirements