Amazon Elastic Compute Cloud (EC2): Part-1

Amazon Elastic Compute Cloud (EC2): Part-1

What is EC2:

EC2 is a service provided by AWS to create virtual machines/servers on the AWS cloud.

Why we need EC2:

Let's take an example, you created one application and now you want to deploy it so that it will be available for the users, so to deploy that application you need to have an infrastructure meaning hardware, software, networking solutions, data storage and many more things.
The hardware here is nothing but a machine/server on which you will be deploying your application but the thing is for you or for some startup companies it's not possible to create an infrastructure from scratch in the initial days as it requires more money to set up all the things.
To solve the above problem we go to cloud providers like AWS where we can set up virtual machines with the help of EC2 service and as aws provides services on a kind of rent i.e you need to pay as per your usage so it requires less amount of money as compared to buying a physical server.

How to create EC2 server:

Step 1:

Once you log in to your aws account, you need to search for the EC2 service

Step 2:
Once you land on EC2 dashboard, click on Launch Instance.

Step 3:
Next, you can give a name & tag to your EC2 instance.

Step 4:
Next, you need to choose an AMI (Amazon Machine Image).
AMI is nothing but an image of software configurations like operating systems and application servers required to launch the instance, we can choose from available AMIs or can create a custom AMI.

Step 5:

Next, you need to choose an instance type. there are many instance families and their respective instance types available, every instance type will be having a different configuration of CPU and memory.
Once we choose an instance type then we can create a key pair that we can use while connecting to our ec2 instance.

Step 6:

Next, we need to choose a security group, security group acts as a virtual firewall to our ec2 instance, using which we can control the incoming and outgoing traffic to/from the ec2 instance.
While creating a security group we can specify the inbound and outbound rules depending on which traffic will be allowed or blocked toward ec2 instance.

Step 7:
Next, you need to configure the storage as per the requirement of your application.

Step 8:

Finally, you can review the configuration, once done Click on the launch instance.
In a few minutes, the ec2 instance must be up & running.