Amazon EC2 – Host Your Application in Cloud

Getting Started With Amazon Web Services EC2

Getting Started With Amazon Web Services EC2

Officially called Amazon Elastic Compute Cloud(EC2) is your remotely located virtual laptop also called instance. It’s similar to what you get from Slicehost, Rackspace with some really cool features. One of the earliest Amazon Web Service and quite mature now. You host your website here. The article is for beginners who want to get started with amazon web services.

What Does Amazon EC2 Do?

It’s the place where you deploy your application. Your code runs here. Install your application, libraries, tools here. You choose type of instances(micro, small, medium, large, xlarge) and computing power based on you needs. Isn’t it funny type of instances are like size of t-shirts you find in mall.

You login to EC2 server using ssh. Always create private keys for ssh login. For more security you create NAT group. First you login to NAT then you login to respective EC2 server. NAT acts as front gate to public internet. It’s double security. Isn’t it?

What Makes Amazon EC2 Different?

  • Create your own AMI(Amazon Machine Image) to avoid duplicate work of configuring applications, installing  libraries, setting up server. After your AMI is created you launch an EC2 instance from your own AMI.
  • EC2 makes strong financial sense for startups. It has literally zero setup costs. You only pay for the boxes when they run, and you only pay for storage that’s actually in use. So your startup costs are minimal.  It encourages experimentation at the hardware level: spin up 10x more capacity than you need, run load tests, and then spin them back down until you really need them.
  • Pricing is hourly basis. No need to pay in advance for your server for a week/month like traditional systems. Also you can reserve an instance and save upto 50% of money.
  • Handle large EC2 machines through API calls . For e.g. terminate an instance with TerminateApi call. No need to login to Amazon Management Console for basic operations. Also all historical API calls are recorded for security and debugging purpose. Make sure you enable CloudTrail logging.

How It’s Priced?

You might be thinking so many cool features as compared to traditional hosting providers. This must be costly!

No that’s incorrect.

Pricing of EC2 is very transparent. Pay what you use. You are charged for number of hours your instance ran not like traditional hosts who charge in advance for fix amount of time. Each instance launch time is recorded and charged for duration when it was up. There are many more ways to save money. Reserve your instances. You can save money more by bidding for spot instances. Isn’t it cool and cheap!

It will be great if Amazon can launch a feature to bill in minutes instead of hours. Will save lot of money for high traffic businesses.

Why Would You Use Amazon EC2 for?

Amazon EC2 - Launch an Instance

Amazon EC2 – Launch an Instance

Launching New Server

The biggest difference and advantage of using EC2 is flexibility. Yo can spin up a new box very, very quickly— about 5 minutes from thinking “I need some hardware” to logging into the shell for the first time, ready to go. It’s easy as pie. Also it’s backed by the very supportive Amazon support team.

Deploy Application

Host your small/big app and start serving user requests. Variety of operating systems from Linux, Ubuntu, Windows Server etc. are supported. List is large and it keeps growing. You setup CloudWatch alarms in case your server is going down on high utilization. CPU, RAM, Pricing can be monitored by click of a button.

Complete Control

EC2 based hosting is fully under your control. You get a ‘blank’ server with a public/private IP for you to configure as you like. It’s not heroku where you have to work heroku way.

AutoScaling

Monitor EC2 usage from dashboard. Upgrade, downgrade as per  your application needs. Autoscale EC2 instances as per the condition set by you. e.g. Launch another instance automatically if your CPU usage goes above 80%. Isn’t it interesting!

More example : Launch an instance when marketing newsletter needs to be sent. Terminate the instance after it’s sent. All through automated API calls.

Run Your Small Website/ Blog for Free

AWS Free tier let’s you experiment with EC2 instance for 1 year totally free. A good marketing strategy for Amazon to acquire customers. Good for customers too. You can host your small website, blog for free. More details : AWS Free Tier Unknown Facts

How To Get Started

Amazon Web Services is one of the largest cloud providers in the world. 2015 saw their revenue highest among all cloud service providers including Microsoft, Google, Rackspace. It’s high time cloud developers you get started with AWS EC2. If you’d like to get started with the basics of EC2 and get a feel for what it can do, I’d recommend the AWS tutorial on Hosting a WordPress blog with Amazon EC2.

Official Doc: Hosting a WordPress Blog with Amazon Linux

If you want to learn more about amazon web services, read below articles:

If you like my article please like our Facebook page and also follow us on Twitter so that you get regular updates. For regular updates you can also subscribe to www.hackpundit.com

Please also share on Facebook and Twitter to help other cloud developers.