So you registered for Amazon Web Services
kevin10 Nov 2010
Subtitle: Some useful notes on my first AWS EC2 usage session.
As some of you may have already guessed, I really appreciated the Free Usage Tier by Amazon starting on 1st November. So right on 1st November I registered to AWS and I created my very first instance on the Amazon cloud. In a few minutes my machine was up and running. But as a newbie I must admit I stumbled upon some little problems and misunderstandings that I think may be common to other AWS newbies.
Before starting: be careful, this is not meant to be an EC2 tutorial.
The first thing I wanted to test was the creation of a new instance. This is the easiest thing to do starting from the Management Console: just click on the big button “Launch an instance” and follow the steps. The first step of the wizard will let you choose the AMI to use to instantiate your machine from the ones displayed into the Quick Start tab. If you are familiar to OOP an AMI stands to a running instance just like a Class stands to an Object. Here’s the screenshot of the Quick start tab:
I wanted to try something cool, so I decided to run the third AMI of the list, the one based on SUSE Linux Enterprise Server 11 32-bit. Ok, I know, the 15GB of mass storage needed by this AMI throws me out of the free usage. But once upon a time I installed SUSE ES on a physical machine, and it took me more or less an hour to have it up and running. Creating it in a few second is a little bit more fascinating to me. Anyway, as the description states this machine seems to have “Apache 2.2, MySQL 5.0, PHP 5.3, Ruby 1.8.7, and Rails 2.3″ installed and ready to work. But soon I realized that it was not so true. As a matter of fact this AMI is designed to to have a basic install and has all the other software available for easy installation. This means it is predisposed for an easy installation of these packages, but none of them is already installed. In order to install Apache HTTP Server and MySQL you have to execute some commands:
1. perpare the pacakges
zypper in apache2 mysql
2. enable the services on boot
chkconfig apache2 on
chkconfig mysql on
3. and then start them
service apache2 start
service mysql start
Now I had my apache server and my database ready to work.
But here we went a step further. When I first launched my instance and got the green badge on it, the very first thought have been: “And now? What am I supposed to do?”. After a few seconds I realized I had a huge list of things to do, here are some:
- how can I connect to and interact with my server?
- is this alredy reachable, or do I need to attach a public IP? how?
- may I connect to my server using an FTP/SSH client?
- can I deploy my website?
Well, we already answered the last question, so let’s go quickly through the others.
- You can connect to your server and control it simply using Terminal (on OSX), for example. If you right-click on your instance and select “Connect” a popup window will display and will clearly guide you through the steps needed to set up the SSH connection.
- Yes, it is already reachable thanks to a public domain name automatically created by the service, something similar to “ec2-xxx-yyy-zzz-kkk.compute-1.amazonaws.com”. Anyway you can always reserve a public IP and attach it to your machine using the Elastic IP service.
- Yes, for example is very easy to configure Cyberduck (OSX again..), just remember to open the right ports on the Security group associated with your machine.
After the first experience with the SUSE AMI, willing to adhere to the free usage limitations, I wandered for other AMIs letting me create a micro instance. But soon I realized that only a few, both into “Quick start” and in “Community AMIs” tabs admit a micro instantiation. And most of all you are not able to know it until you try to instantiate one (AMIs description is often very generic). So you’ll have to try out some of them before getting the right one for your needs.
Other important questions about EC2 are usage tracking and billing. You will be able to keep it all under control not directly from the Management Console, but using your Account section on the AWS site.
In the end I’d like to recommend a couple of useful tools you’ll can’t live without: Elasticfox, an extension for Firefox, and Simple Command-line tools for EC2 and S3.
