Wednesday 12 April 2017

Getting started with Amazon Web Services (AWS)–Create an EC2 Instance

As you are already aware of Amazon Web Services (AWS) that offer on-demand cloud computing solution with a pay-per-use approach. As Amazon offer 12 months free trial to check out their services, we exactly going to do that and also recommend you sign up for AWS Free tier. If you already did then let’s get started and learn together on how to create an EC2 instance in AWS.


First, take a quick look at Amazon Free Tier benefits:

Amazon EC2 (Compute)
  • 750 hours per month of Linux, RHEL, or SLES t2.micro instance usage
  • 750 hours per month of Windows t2.micro instance usage
Amazon S3
(Storage)
  • 5GB of standard storage (20,000 Get Requests, 2,000 Put Requests)
Amazon RDS
(Database)
  • 750 Hours per month of database usage
  • 20 GB of DB Storage: any combination of General Purpose (SSD) or Magnetic
  • 20 GB for Backups (with RDS Magnetic storage; I/Os' on General Purpose [SSD] are not separately billed)
  • 10,000,000 I/Os'
Amazon QuickSight
(Analytics)
  • 1 GB of SPICE capacity 1 user perpetual free tier
  • 10GB of SPICE capacity the first 2 months for free for a total of 4 users
Offers that won’t expire after 12 months
  • AWS Lambda, DynamoDB, AWS Database Migration Service etc..

A. Log in to your AWS-console;
aws console

B. Go to Services on top left corner and select EC2, to enter in EC2 dashboard;


ec2_launch instance

C. Now click on “Launch Instance”


To successfully launch an EC2 instance you have to follow 7 steps:


1. Choose Amazon Machine Image (AMI)

aws choose ami
  • You can choose any AMI from amazon marketplace as per your requirement but in this tutorial, I will focus only on free tier eligible products and services. Therefore, I am selecting Amazon Linux AMI (64-bit)
2. Choose an Instance type
 aws instance type
  • Select General purpose t2.micro (free tier eligible) instance and click on “next Configure Instance Details”
3. Configure Instance Details
 configure instance aws
  • You may leave the setting to default but I want you to look into the settings:
    • Subnet: you may choose any one default subnet available or may create a new subnet;
    • Auto-assign Public IP: keep it as default (use subnet setting (enable). If needed, you may enable elastic IP to connect it to your domain;
    • Enable termination protection: check this to protect against accidental termination;
  • Click on “Add Storage” button.
4. Add Storage
 add storage aws
  • You may go ahead with the default setting by clicking on “Add Tags” button or you may increase storage size up to 30GB for Volume type General Purpose SSD or Magnetic storage. (increase storage as per your requirement, make sure don’t decrease it from 8GB)
5. Add Tags 
 add tags ec2 aws
  • Skip this step and continue with clicking on “Configure Security Group”
6. Configure Security Group
 security group ec2
configure security group ec2
  • In Assign a security group: Select “create a new security group” (if you don’t have any) or “choose from existing one”;
  • Provide Security Group name or leave it as default ( launch-wizard-1) – I recommend you to add name which may later help you in identifying the security group;
  • Add description – enter description which makes this security group explanatory for you;
  • In SSH select source My IP (recommended option), so it will allow only your IP to connect to SSH or you can assign custom IP address or just select “Anywhere” (least secure option);
  • Add HTTP to connect to server port to make your instance accessible;
  • For the last step click on “Review Instance Launch”.
7. Review Instance Launch
 review ec2 instance
  • You may go through the summary of your instance. In case you want to make any changes, just do it.
  • Once you go through all the details available on Review instance launch, click on “Launch” button, new window pop-up - “Select an existing key pair or create a new pair window”.
  • Now create a new key pair (never proceed without a key pair, otherwise you won’t be able to connect your instance) and enter key pair name;
ec2 key pair
  • Download the key pair and keep it in a secure location as you will NOT be able to download the file again after it's created.
  • Finally, click Launch Instances.
ec2 instance launched 

You have successfully launched an EC2 instance on AWS, now go to your EC2 dashboard and view running instance. This guide may be used for creating a different EC2 instance with different machine image.
On next post, we will move further any see how we can connect to our instance and install WordPress.

0comments:

Post a Comment