Understanding AWS EC2 Essentials

Linu Bajy
4 min readMar 17, 2023

--

Hi Everyone,

In this article , I want to introduce you a very basic but the most important component of Cloud Computing, which is THE EC2.

What is EC2?

An EC2 can be decoded as ECC( ie. C twice), which is short for Elastic Compute Cloud. It is basically a machine that is present in your AWS Cloud. To segregate spaces among different users , we have VPC(Virtual Private Cloud), which can be further sub divided to subnets . It is here where EC2 instances are generally placed.

Understanding the components of EC2

An EC2 is like your personal system except that AWS manages the system for you. We don’t have to worry about physically managing the device or even updating security patches onto the device. How convenient :)

An EC2 can have :

  • OS ,CPU ,RAM
  • Storage — To permanently store data
  • Networking — Connects to other resources in the same VPC
  • Firewall — Restrict Access to EC2 instance using Security Group
  • Bootstrap Script — When an instance is brought up for the first time, we can tell the instance to run commands ,say, for installing apache. Note that you should switch to a ROOT user to perform actions.

Understanding Instance Types and its Purpose

There are mainly 4 use cases of Instances :

1.General Purpose Systems :

These systems are used to provide a good balance between compute memory, and storage.

Use Case: These are widely used to deploy Applications.

Class: T , M , A Series

2.Memory Optimized System:

These systems are used for intense memory usage.

Use Case: Data Analytics like Spark,Hadoop etc

Class : R Series

3. Compute Optimized System:

These systems are used for high performance processors.

Use Case: Gaming

Class: C Series

4.Storage Optimized System:

These systems are used for sequential read-writes. They have low latency, high IPOS(Input-Output per Sec).

Use Case: Applications for Bank Transactions , to read from huge Databases.

Class : D, H, ‘i’ Series

Understanding Instance Type

Lets take an example of ‘t2.micro’

Here ‘t’ can be replaced with any class from above. Here 2 represents the generation number and it can vary as time goes. ‘micro’ represents the size of the system specifications like CPU and Memory.

So its important to choose an EC2 instance type based on your requirement and budget , without compromising on the performance.

Launching an EC2 Instance

Next , we choose the name of the instance to uniquely identify it. We select the OS . Note that the AMI ID will differ for different regions even though the OS can be same.

We select the type of Instance. The price of the instance can vary largely based on the type you choose , so be mindful when choosing the type so that it is apt for your use case .

Although this is an optional step, its always important to generate a key pair. This can help you to access the server and perform troubleshooting when required. Also note that a single key pair can be used for multiple instances. For linux system, we generate a .pem file. This is a very secret file that cant be regenerated again. Hence , make sure to save it well.

Firewall is a very important aspect of EC2 instance. We secure the instance using a Security group. A security group can have inbound and outbound Rules which allow/deny access to the EC2.By default, it will create a security group . Hence make sure that you create only whenever needed. If you already have a Security Group that you can reuse, you can attach it to the Instance

Next you configure the storage for the instance. This is for the Root Volume of the Instance.

In Advanced Settings , you will note that there is a space to add User Data, where you can add commands that it should run when the instance is brought up for the first time.

For Example: Downloading and Installing Apache Server.

AWS displays the summary of our configurations. We can even specify the number of instances required. By default, it is set to 1.

And Voila , there you have your first Instance Launched!!

Make sure you stop/terminate your instance after you use or you can expect a huge AWS Bill !

:P

Fin.

--

--

Linu Bajy
Linu Bajy

Written by Linu Bajy

Enthusiastic Learner . DevOps Professional .

No responses yet