How to create  your AWS EC2 instance and connect it with GIT Bash

How to create your AWS EC2 instance and connect it with GIT Bash

What is AWS EC2 instance?

EC2 is abbreviation for Elastic Compute Cloud. It’s one of the most used services in AWS cloud. It offers businesses a platform for creating virtual machines On-Demand without any upfront cost in AWS datacentre. The underlying infrastructure for hosting the virtual machine is maintained and managed by AWS. With EC2, AWS provides highly available, secure, reliable, simple and automatically scaling infrastructure.

How to create an AWS EC2 instance?

step 1. Logon to AWS admin console using below url.

https://aws.amazon.com/console/

step 2. Go to services and search for EC2 service.

Step 3. Click on Launch instance as below:(In my case region is Mumbai)

Step 4. Give name of instance ,Number of instances and select Application and OS images(AMI-Amazon Machine image)

Step 5. In my case, I am a creating Ubuntu image.

Step 6. I am selecting t2. micro instance type as it is free tier eligible.

Step 7. Next step will be to create key pair to authenticate our ec2 instance.

Step 8. Select key pair name, key pair type and private key format as .pem

A key pair, consists of a public key and a private key.It is a set of security credentials that you use to prove your identity when connecting to an Amazon EC2 instance.

The .pem file works for every Operating System and the .ppk file is only for Windows Operating System. Once you will create key pair, your .pem file will be downloaded.Save that file in some location.

Step 9. Remaining Network settings and Configure Storage I will be them as default and click on launch instance.

Step 10. In this way, we have successfully launched our first ec2 instance.

Step 11. Now we will click on this instance id and get instance summary.

Instance Summary as below:

How to connect to EC2 instance using CLI?

We can use GIT bash to connect to public IP of Ubuntu instance.

ssh -i D:/myfirstkeypair.pem ubuntu@your-public-ip-address

Conclusion

We have successfully launched our ubuntu ec2 instance on AWS console. We will explore more about this Ubuntu instance in further articles. So stay tuned.