How to create an AWS EC2 instance

In this blog we are going to create an AWS EC2 instance.

As per AWS, 

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2 offers the broadest and deepest compute platform with choice of processor, storage, networking, operating system, and purchase model.

So first login to your AWS account and then go to EC2 Services .


Click on Launch instances and select your Amazon machine Image. AMI is the type of OS that you want to boot in your ec2 instance. Amazon offers rich flavours of OS from Linux servers to Windows servers.


Now Choose an Instance type. Instance type is the specification of compute capacity like amount of RAM & CPU. t2.micro is the only instance type that comes under free tier. For all others amazon will charge.


Next Configure instance details like number of instances that we want to boot, aws region (Subnet) where we want to start our EC2 instance and other details.
In the next page we will configure the Size of hard disk that is used in our EC2 instance. By default it is configure to 8 GiB. This Root Volume Type is a kind of AWS EBS which is used to boot our OS (AMI).

In next page we can add tags to our EC2 instance which can be used later to identify a particular instance. This is an optional step. In the snapshot below we have added a tag named Name with value as webserver.
In Security Group page we can configure our firewall. We can add multiple firewall rules like we can add rules for allowing SSH, HTTP, and multiple other protocols. We can define any custom ports and can restrict the access to this EC2 instance. By default every protocol is blocked until we are adding new rules.
In next page Review Instance Launch,we can review the configurations that we have chosen till now. 
Finally we have to choose a key pair for our new EC2 instance. This key pair will act as password to login into this instance.
Lastly we can see our new EC2 instance have been configured successfully. We can see the details of this instance at the bottom page.



To SSH to this instance from an windows machine we can use a tool called Putty.
Before we use putty we have to convert the format of our key-pair file (from EC2Tutorial.pem to EC2Tutorial.ppk). For this we will use another tool called Putty Key Generator.

Click on Load and select your .pem file (EC2tutorial.pem) and click on Save private key and give file name.

Now open putty tool and pass Host Name as ec2-user@publicIPv4Address. Public IPv4 address we can get from previous snapshot.



Then click on SSH => Auth and browse to the private key file (EC2Tutorial.ppk) that we have generated in the above step.

Finally click on Open and Yes in the next dialog box. We are now logged into our new EC2 instance.


That's it. Hope you have learned something new today. Please comment below if you face any challenges in this post.

Happy Learning.

Comments

Popular posts from this blog

Create custom VPC with private and public subnets