Creating a Key Pair and Security Group in AMAZON EC2
How to create a Key Pair?
Sign in to AWS Console using https://aws.amazon.com/
After successful login you will land in Dashboard. From there choose EC2. Click on Navigation bar and there you can select a region. Region need not be the location you belong to. You can choose any region irrespective of your location. But one thing to remember is that a key pair is specific to a region. That is to say, to launch an instance in the Ohio Region, your key pair must be created in same region.
After you select the region. In Navigation pane go to NETWORK & SECURITY. There you will find Key Pairs. Click on it. And then click on Create Key Pair.
You can give a name of your choice to the keypair but its good to give a name which is easy to remember.
This will automatically download a private key file with an extension .pem. Save it somewhere in your computer from where you can access it easily. This will be required to login to your EC2 in future.
Creating a Security Group in EC2:
Security groups control the traffic coming into and going out of an Amazon EC2 instance. You can call then as firewalls within EC2. In EC2 each instance must be connected to a Security Group.
Security groups are region specific. Security group of one region is not accessible from another region.
Go to Amazon EC2 console. From navigation bar go select a region as done before in this article while creating a key pair.
In left navigation pane select Security Groups. Thenclick on Create Security Group.
Give a name to the Security group and a description. Choose a name which is easy for you to remember.
When you select a security group you can see 4 tabs.
Description, Inbound, Outbound, Tags
Click on Inbound tab. Then click on Edit.
- Select HTTPfrom the drop down list Type, by default Source will be set to Anywhere(0.0.0/0).
- Select HTTPSfrom the drop down list Type, by default Source will be set to Anywhere(0.0.0/0).
- Select SSHfrom the drop down list Type. In Source text box, give the IP address of your local computer.