HowTo: Create a RHEL AWS Image (free tier)

 

This post lists the steps needed to create a simple RHEL image on Amazon AWS EC2 service, using the AWS free tier quota.

Pre-requisites (Follow the steps given here. A brief overview is given below)

  1. Create a AWS account at http://aws.amazon.com (and choose sign in to console). If you are an existing amazon user (for shopping purposes), same account can be used to login to AWS too.
  2. In order to restrict access, you may create Amazon IAM (identity and access management) users. These users can be given specific permissions and will not be able to look at billing information for e.g. We created a group with three users and gave them administrator privileges. Also, we used the Singapore zone for our hosts. Steps to be followed: Create IAM user
  3. AWS images can’t be accessed using passwords. Instead, you need to create public/private key pairs to access them. Each machine is associated with a key pair. The public key is stored on the machine image, while you provide the private key while loggin in. To create a key pair follow : Create a key pair
  4. Create a Virtual Private Cloud (VPC). Its like a virtual network in the cloud where your hosts can reside. A default VPC is provided in most regions and so may be skipped. Follow: Create a VPC
  5. Create a security group. A security group allows fine tuned access to the hosts you create. For e.g. if the host can be pinged, can be accessed through HTTP, and whether it will be reachable through SSH. During our dev phase, we opened our hosts to be connected through SSH from any IP, but you can restrict so that only specific IP addresses can SSH to your hosts. Follow the steps: Create a security group.

Create a RHEL instance on EC2

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ , login using IAM user (see pre-requisite#2 above), or your AWS user, and select ‘Launch Instance’
  2. On Step1 page (Choose an Amazon Machine Image (AMI)), select the RHEL Image (make sure it has ‘Free tier eligible’ tag), and on Step2, select the ‘t2.micro’ image.  Click the ‘Configure Instance Details’ button.
  3. On Step3 (Configure Instance  Details), select the Network to your VPC if you created one (else choose default if available). Also MAKE SURE to mark the option ‘Auto-assign Public IP’ as Enabled (otherwise machine will not have a public IP). Press the ‘Next-Add Storage’ button.
  4. On Step4: Add Storage, you can add upto 30GB of storage as allowed by the free tier. Press ‘Next-Tag Instance’.
  5. On Step 5, you can add a custom tag to your instance if you wish. Press the ‘Next-Configure Security Group’ button.
  6. On Step 6: Configure security group, select the ‘Select an existing security group’ option, and choose the security group you created (as part of pre-requisites step#5).
  7. Finally,  you are ready to review and launch your instance. It will ask for the key pair you wish to associate the instance with, where you should provide the key you created in pre-requisite step#3.

Once launched, it will take a few minutes before you can use the instance. On the instance summary page (Click ‘Instances’ on AWS EC2 console), ‘Instance State’ should be running, and ‘Status Checks’ should be green.

Once the instance is ready, you will be able to see its Public DNS and Public IP. If you opened up ICMP packets in your Security Group setting, you should be able to ping the new host.

To connect to the new host using SSH, follow this guide. Make sure you have the private key you generated in pre-requisites step#3.

Posted on: 1st May 2016, by :

Leave a Reply

Your email address will not be published. Required fields are marked *