Skip to main content

Launch my first EC2 Instance

EC2 Instance

Amazon Elastic Compute Cloud is a web service provided by Amazon to spin up desired type Virtual Machine in any available Region.
Let’s see how to launch an EC2 instance or Virtual Machine.
After we have successfully created an account in AWS and logged in, Select EC2 from the service drop-down.

We need to select the region from the top right corner drop down in which EC2 instance to be launched. I have selected Singapore as an example. Click on the Launch Instance button.


In this step we need to select what operating is needed for the EC2 instance. There are multiple options available like Amazon Linux, RHEL, SUSE Linux, Ubuntu, etc..

Let’s select the checkbox beside Free tier only to be sure we are selecting the template that is free for practicing.         
In this step, we need to choose the computing power needed for the EC2 instance. Lets select t2.micro type as highlighted in the screenshot below and click on Next: Configure Instances Details button.
Enter the number of instances to be launched. Let's keep default network and we can choose the Availability Zone of our choice otherwise AWS will choose one of the AZ by default. Also, select Enable from the Auto-assign Public IP drop-down for EC2 to be accessible from the internet.
Then click on Next: Add Storage button.
By default, Root mount point is available and we can add any additional mount points if needed.
Note: There is no option to encrypt the Root mount. You can encrypt while creating the AMI from the Root volume snapshot.
Click on Next: Add Tags button.
Add Key as Name and Value as My First EC2 Instance.  This is optional, but it will be helpful to differentiate when we have many instances.
Click on Next: Configure Security Group button.
In this step, you may create your custom security group name or retain the default name. Select All traffic in the Type drop-down and Anywhere from the Source dropdown. This will set the rule to allow connectivity to EC2 instance from anywhere.
Then click on Review and Launch button.
Verify all the details of the EC2 instances and click on Launch button.
There is no existing key pair so let’s create a new key pair.
Select Create a new key pair from the drop-down and enter a Key pair name. Click on Download Key Pair to download the pem file. Then click on the Launch Instances button.
This the screen indicates that options selected are good to launch the EC2 instance in selected AZ and region. 

Launch the puttygen tool to convert pem file to ppk file.
Click on Load button and browse pem file download. Successfully imported foreign key message should appear. Then click on OK button.
Click on Save private key button

Click on Yes in the Puttygen warning and save the file with extension PPK.  
Navigate to EC2 instance in the AWS console and Check the status of the Instance is running and 2/2 checks is successful. Also, Note IPv4 Public IP.
Launch the putty and enter the public IP in the Host Name (or IP address) text box.
Expand SSH and select Auth from left-hand pane. Click on Browse to select the PPK file saved in the above step.
Click on Open button.
Click on Yes in the PuTTY Security Alert popup.
Enter the AWS EC2 default user name ec2-user. This will allow to login without any password successfully.














Comments

Popular posts from this blog

VPC Peering

VPC Peering VPC Peering feature is used when we need to establish connectivity between subnet in two different VPCs in the same or different account. Let’s take a scenario of creating VPC Peering between two VPC in the same account to keep it simple. NOTE: All the IP address and CIDR range depicted in the below diagram and subsequent steps is for example only. Step 1: Create a VPC A with CIDR Range 10.0.0.0/16 and keep Default in Tenancy dropdown.   Step 2: Create a VPC B with CIDR Range 172.16.0.0/16 and keep Default in Tenancy dropdown.  Step 3: Enter Name tag as SubNetA and map to VPC A in VPC dropdown. Note that VPC CIDRs of VPC A is auto-populated and status as associated. Selecting Availability zone is not mandatory. However, AWS will select one of the Availability Zone when we create a subnet. Enter 10.0.1.0/24 as IPv4 CIDR block and then click on Create button. Step 4: Create SubNet A and map to VPC B in VPC dropdown. Note that CIDR o

IP Sec Tunneling

Requirement: Establish connectivity between the on-premise data center and AWS data center using IPSec tunneling.  Solution: We are creating IPSec Tunneling between two VPC in a different account and the different region as we don’t have on-premise data center.  Steps to achieve this. 1.        Create VPC A with CIDR Range 10.100.0.0/16 in First account. 2.        Create Subnet A in VPC A with range 10.100.1.0/24 3.        Create Internet Gateway and attach to VPC A. 4.        Add the Route (0.0.0.0/0) in default Route Table and target to Internet Gateway. 5.        Create VPC B with CIDR Range 10.200.0.0/16 in Second account. 6.        Create Subnet B in VPC B with range 10.200.1.0/24 7.        Create Internet Gateway and attach to VPC B. 8.        Add the Route (0.0.0.0/0) in default Route Table and target to Internet Gateway. 9.        Below steps to be executed at VPC B a.        Launch the EC2 instance in VPC B with Public IP enabled.

NAT Gateway

NAT Gateway Create a VPC with two subnets and allow public access to EC2 instances only on one subnet. Then enable the internet to EC2 instances in Private Subnet. Requirement: Create EC2 instance in private Subnet and provide Internet access using NAT Gateway. Solution: 1.        Create One VPC with CIDR Range 10.0.0.0/16 2.        Create a private Subnet with CIDR Range 10.0.1.0/24 3.        Create a public Subnet with CIDR Range 10.0.2.0/24 4.        Create One Internet Gateway and assign to VPC. 5.        Create one custom Route table and associate Public Subnet. a.        Create a global route (0.0.0.0/0) and target to IGW 6.        Associate private subnet to default Route table 7.        Launch one EC2 instance (VM1) in public Subnet with Public IP enabled. 8.        Launch another EC2 instance (VM2) in private Subnet with only Private IP. 9.        Navigate to VPC à Nat Gateways 10.    Click on Create NAT Gateway button 11