In this post we will create and Amazon Linux Instance from Amazon AMI by using Amazon Management Console.
The obvious question in beginner’s mind is what is Amazon EC2?
In plain simple English, it provides resizable (elastic) compute capacity in Cloud environment. In traditional environment, the biggest challenge is to acquire (provision) resources (in our case it is compute / Server /Virtual Machine / Physical Machine). Pay as you go billing model provides immense flexibility to create compute resources in Public Cloud environment with the use of Amazon EC2.
Go to aws.amazon.com
Click on My Account, and select AWS Management Console from the drop down menu.
Sign in with AWS credentials.
AWS Management Console, Click on EC2 in Compute Section.
It will open Amazon EC2 Dashboard. Just observe Resources section, you will have only 1 Key Pairs and 1 Security Group if you have created account recently and using it first time. Click on Launch Instance to create a new virtual machine.
Step 1 is to choose and AMI – Amazon Machine Image, a template that contains operating system, web or application server, applications, etc. that are required to launch instance. We will select Free Tier Eligible AMI – Amazon Linux AMI. Click on Select.
In step 2, we need to select Instance type. Don’t get confused with terminologies. Instance type is nothing but a type of Virtual Machine. Each Instance is a distinct combination of Type of instance, vCPU, Memory, Storage, Network Performance based on the use cases considered by AWS based on patterns decided by them. We will keep t2. micro and click on “Next: Configure Instance Details”
In step 3,Configure the instance section provides some very important details. Observe “Number of Instances” parameter :-). In simple terms, it means that we can create multiple instances with same kind of configuration with in quick time. Easy, isn’t it?
Some other important information which we will cover later on is Network, IAM, etc. related details.
Click on Next:Add Storage.
In step 4, we can configure storage for the instance. E.g. We can configure size of available disk or we can attach additional EBS volumes and instance store volumes. Click on Next: Tag Instance.
In Step 5, a tag is nothing scary but a case-sensitive key-value pair. We can keep multiple instances with same tags. We will see how it can be useful in later posts. Click on Next: Configure Security Group.
In Step 6, configure firewall rules that will control inbound traffic for Amazon Linux Instance. We can Add Rule. By default, SSH Rule is added for port 22. We can create or use existing security group. Click on Review and Launch.
In Step 7, Review Instance Launch-Review all details of an instance and click on Launch.
It will open a dialogue box of “Select an existing key pair or create a new key pair”. Select a Key pair and click on Launch Instances.
Verify the Launch Status.
Click on View Launch Log to find more details.
Click on the Amazon Ec2 Service and view the instance on Dashboard. Note Public DNS value that we will use to connect to the instance.
Once Instance State is Running, we can use putty to connect it.
To connect with newly created Amazon Linux Instance, we need Putty.
PuTTY is a open source free implementation of SSH and Telnet developed originally by Simon Tatham for Windows and Unix platforms. Download PuTTY here.
In Host name, Enter Public DNS value that we noted earlier.
Use following format: email@example.com
Now, another very important question is, what is the default user name and password?
User name is ec2-user, and as we have provided Private Key, we need not to give password while connecting to the Amazon Linux Instance.
In the Auth section, select path of the PPK File in Private key file for Authentication.
It will open a dialogue box for Putty Security Alert: The Server’s host key is not cashed in the Registry. Click on Yes.
It will open Putty Console using User name “ec2-user”. Execute sudo yum update command to update all packages.
Verify other commands and directory structures too.
Verify ifconfig command: