I will attempt to explain the AWS tech we are using as best I can.  However, I am not an AWS expert nor do I play one on TV.  For things such as this, my main goal is typically: "make it work".  What I am showing you is what I have been able to make work.  Not too bad for a human if I do say so myself, and I just did.

As you will soon see, there are a plethora of available pre-built machine images available.  Most of them are free, but there are just as many pay-for instances.  I suggest choosing a free one.

I prefer using an "empty" image because I like knowing where everything is: where and what JDK version (Sun JDK 1.6.x), Tomcat (6.0.35), etc.  You get the idea.  There is nothing worse than having to go on an easter egg hunt looking for config files, log files, etc.  If I install it, I know where it is.  If you are using the pre-built AMI's you will have to figure out their install structure and locations.

Feel free to use a pre-built AMI, and just extrapolate the instructions here.  You should be OK for the most part.  If you have issues, I doubt the instructions here will be of much help.  But as I have seen, you should be able to eventually find an answer to your problem.  The AWS community is pretty verbose, so it's just a matter of time until you resolve your issue.

You must first create an AWS account - without that you won't be able to do any of what we are talking about here.  To give you an idea of cost, I have been running my AWS instance most days 24 hours a day, and spending about 15 bucks a month.  I have been using the smaller instances, with a small amount of disk: 20G.  The beefier instances I am guessing are gonna run me around 3 times that, but again, its gonna be worth the money.

You should be able to figure out how to create an AWS account by yourself.  Here is a link I found to walk you through doing that.  You will need to associate a credit card with your account to use the non-free tier - which is essentially anything larger than 613M memory, 32bit, 1ECU (elastic compute unit).

I also recommend purchasing (if you don't already own) a DynDns account, or some service that is similar.  This will be beneficial later on in the process to simplify access to your new AWS instance.  It is not strictly necessary, but makes some things easier.  There are work arounds, but honestly it's a pain in the butt that goes away simply by paying a few dollars a month.  Worth the money if you are as busy as me.

Here is lesson number 1: DONT use a 32 bit architecture.  Here is what happened to me, not once, but twice.  Mistake #1 - I create a 32bit VMWare Ubuntu instance under the premise: "I will NEVER need something bigger than THAT."  BZZZZT!  Fail #1.  I recreate my ENTIRE environment on a 64bit Ubuntu VMWare image.  (Pain in the butt...)  Mistake #2: I create a 32bit AWS AMI with - yep, you guessed it, the same faulty premise. I am now in the process of migrating my 32bit installation to a 64bit one.  Yes - a pain in the butt.

How to create this darned thing?  Go to this URL: http://cloud-images.ubuntu.com/precise/current/ and pick a 64bit AMI that is in your region.  OK, whats a region... Well, exactly what it sounds like: uswest, useast.  Pretty simple, if you are on the east coast use useast, and use uswest if you aren't.  For right now, the numbers don't mean too much.  Later they will, but right now, we don't care.

[[{"type":"media","view_mode":"media_large","fid":"46","attributes":{"alt":"","class":"media-image","height":"203","typeof":"foaf:Image","width":"480"}}]]

Also, select one that is an ebs root store.  Ebs means elastic block store - another service that AWS offers.  What does it all mean?  I don't know the difference between the different root stores, sorry.  I just happen to always use ebs.  To reduce confusion, select the region here corresponding to where you are physically located.  You will see the mistake I made below.

Click "Launch" on your chosen image.  The first of five screens will not have any editable fields on it, simply click "Continue".  The second screen has many editable fields, here is what you are concerned with:

[[{"type":"media","view_mode":"media_large","fid":"47","attributes":{"alt":"","class":"media-image","height":"326","typeof":"foaf:Image","width":"480"}}]][[{"type":"media","view_mode":"media_large","fid":"48","attributes":{"alt":"","class":"media-image","height":"325","typeof":"foaf:Image","width":"480"}}]]

  • Number of Instances : 1
  • Instance Type: Micro (t1.micro, 613MiB)
  • Availability Zone: No Preference

click "Continue" and you will still be on the second screen "Instance Details", simply click "Continue" again, there is nothing to change here.  Again, we are still on "Instance Details" and there is nothing to change on this screen either, click "Continue".  Do this one more time, the "Key / Value" tag screen has nothing to be changed.  Here are the corresponding images:

[[{"type":"media","view_mode":"media_large","fid":"49","attributes":{"alt":"","class":"media-image","height":"326","typeof":"foaf:Image","width":"480"}}]][[{"type":"media","view_mode":"media_large","fid":"50","attributes":{"alt":"","class":"media-image","height":"323","typeof":"foaf:Image","width":"480"}}]]

[[{"type":"media","view_mode":"media_large","fid":"51","attributes":{"alt":"","class":"media-image","height":"326","typeof":"foaf:Image","width":"480"}}]]

OK - FINALLY something to do.  The screen "Create Key Pair" you have stuff to do.  Enter a name for your key pair, it can be anything: HeidsHotdogs, FarmingtonDiner, EasterBunny, etc...I prefer FarmingtonDiner even though it no longer exists.. Don't worry, I will cry myself to sleep.  Click "Create and Download Key Pair".  This will save a file: FarmingtonDiner.pem to your filesystem.  Stick that bad boy somewhere safe.  Without that you won't be logging into your new shiny AWS instance.  Well, not entirely true.  But for what we are setting up, you need it.

[[{"type":"media","view_mode":"media_large","fid":"52","attributes":{"alt":"","class":"media-image","height":"327","typeof":"foaf:Image","width":"480"}}]][[{"type":"media","view_mode":"media_large","fid":"54","attributes":{"alt":"","class":"media-image","height":"325","typeof":"foaf:Image","width":"480"}}]]

Now on screen "Configure Firewall" - we may as well set some of this up now.  Even though we won't use it immediately, the work will not be wasted, we will need it later.  Click "Create a New Security Group" - and like Andy Garcia said in Things to Do in Denver When you're Dead... Give It a Name, well, and a description too.  Then one by one you will add Custom TCP Rule's for the following: 22, 80, 4502-4503, 8080, 10000.  So that is a total of 5 firewall rules, 4 single TCP/IP port rules, and 1 TCP/IP range rule (4502-4503).  Do not change the source value on any of the rules.  Click "Continue".

[[{"type":"media","view_mode":"media_large","fid":"55","attributes":{"alt":"","class":"media-image","height":"327","typeof":"foaf:Image","width":"480"}}]]

Now you are at the "Review" screen.  Click "Launch".  You now see a screen stating that your instance is being launched, you can click "Close".  You will now be at the AWS console.  Bookmark this.  You will be using it alot.  Click on the "Instances" option in the left hand NAV.  After the browser has refreshed, in the upper right hand corner click the "Refresh" button.  You will likely end up clicking it many times until your instance has started up.

[[{"type":"media","view_mode":"media_large","fid":"56","attributes":{"alt":"","class":"media-image","height":"238","typeof":"foaf:Image","width":"480"}}]][[{"type":"media","view_mode":"media_large","fid":"57","attributes":{"alt":"","class":"media-image","height":"95","typeof":"foaf:Image","width":"480"}}]]

Eventually you will see your instance running.  The mistake I made was selecting a uswest region, and by default my "home" region is useast.  The console will default to your "home" region, and therefor not show you your running instance.  I had to select "US West (N California)" in the upper left hand side of the console under "Region".  Once I did that, I now see my running instance.  The downside is that this instance will only run in that region.  There may be a way to change that, but right now I don't know what it is.  Maybe this will be a post later on.

Creating a new snapshot
[[{"type":"media","view_mode":"media_large","fid":"58","attributes":{"alt":"","class":"media-image","height":"146","typeof":"foaf:Image","width":"480"}}]]

Now for the good part.  We took an AMI someone else created, and now we are going to start making it our own.  Right click on your running instance and select the third item from the top: Create Image (EBS AMI).  This will pop up a new window with a bunch of information to enter.  Fill in:

  • Image name:  this can be ANYTHING
  • Volume Size:  change this from 8 to 20 - for what we will be building use no less than 20

Click "Save" then click "Yes, Create".  Now click on the "Snapshots" menu option in the left hand NAV, and wait for the snapshot to be completed.  This could be quick, or it could take as long as 10 minutes or so.

[[{"type":"media","view_mode":"media_large","fid":"59","attributes":{"alt":"","class":"media-image","height":"290","typeof":"foaf:Image","width":"480"}}]][[{"type":"media","view_mode":"media_large","fid":"60","attributes":{"alt":"","class":"media-image","height":"139","typeof":"foaf:Image","width":"480"}}]]

You only have to change the volume size this one time, unless you get to a point where you need to grow it larger.  The process immediately above is what you use to preserve the current state of your AWS instance.  We will cover this again in the next post.

Now lets click back on the "Instances" menu item, right click on your running AMI and click "Terminate".  When the window pops up, use the defaults and click "Yes, Terminate".

Requesting a Spot Instance
Now click on the "AMI" menu option from the left hand NAV, right click on your new AMI and select "Request Spot Instance".  This is what you will want to use from now on.  This is the cheaper option than reserved instances.  You are basically bidding on CPU time against everyone else.  Typically the prices are pretty stable, but occasionally they spike.  The idea is you specify a range for what you are willing to pay.  But I am getting ahead of my self.

[[{"type":"media","view_mode":"media_large","fid":"61","attributes":{"alt":"","class":"media-image","height":"326","typeof":"foaf:Image","width":"480"}}]]

On this screen, leave "Number of Instance" at its current value.  For "Instance Type" select "Medium m1.medium" - we will need the extra memory later on.  Look at "Current Price" and change the "Availability Zone" at the bottom.  You may or may not see the price change depending upon what the current Instance Type price is.  The main thing you are specifying here is the "Max Price".  This is the maximum amount you are willing to pay.  As long as the current price is beneath what you specify, you instance will continue to run.  If the spot price goes over your bid, your AMI will terminate, and your EBS volume will be deleted - and NONE of the AMI changes you have made will be saved.

Now, you can configure your instance so that your changes will be persisted, but like most things it will cost you extra, and this is not how I have it setup currently.  I am still unsure of the price difference between what I am doing, and setting my AMI up to persist when it terminates.  What I have now works, and don't feel comfortable yet to mess with it.

Depending upon the spot price, you may leave the Availability Zone at No Preference, or you may select the one that is cheaper.  Using this URL you can get an idea of the historical price for the various AMI Instance Types vs the region.  Click on Spot Requests, then click on "Pricing History".

OK, now that we have selected the Number of Instance - 1, and the Instance Type - Medium m1.medium, click "Continue" 4 times until you get to the "Configure Firewall" screen.  Here select the security group we created earlier on.  You may have noticed on the root disk screen that our volume size is now 20G.  Now click "Continue".  Again we are at the "Review" screen, click "Submit".

We will now have to wait for our spot request to be accepted, and for our image to start up.  Once started, we are now ready for the arduous task of installing and configuring our needed servers.  What about changes on our running instance?  We will see about that very soon.

The cheap way to connect to your instance is this. This method will give you the ability to connect until we get to setting Putty up to automate things a little.  Go to the "Instances" menu in the left hand NAV.  Right click on your running instance, and select "Connect" - the very first option.

[[{"type":"media","view_mode":"media_large","fid":"63","attributes":{"alt":"","class":"media-image","height":"405","typeof":"foaf:Image","width":"480"}}]]

Now simply click "Launch SSH Client".  Until our next Suarez...

Enjoy.