[Article] Article: Getting started with Amazon Web Services

I. Introduction

Have you ever wanted to learn linux? Maybe host your own blog? Game server? Maybe a brand new cat meme generator? Well, I am here to help. And so is AWS. What is AWS you say? AWS, or Amazon Web Services, is what people talk about when they say 'the cloud'. It allows companies and people to rapidly deploy (and destroy, if needed) almost any computing need. This includes things like databases, servers, DNS, storage, and email services. All these things once created are billed for usage. There is almost no 'flat fee' for anything. While the premise sounds scary, it actually vastly cheapens and simplifies the entire process. Since you only 'rent' what you need, resources can be easily increased and decreased.

As an example, this site used to be hosted on a leased physical server. Since its not easy to provision new resources in the physical world, you have to buy a lot more than you need to account for growth. At the time, I was paying over $100 a month for the server. Fast forward to now. I can easily spin up new servers when needed to account for load, and then turn them down when they aren't needed anymore. Since it's all virtual, its easy. And depending on the month, it sometimes costs me half (or less) of what I was paying before. Additionally, AWS has large datacenters all over the world. So if UF suddenly got big in Japan, I could quite easily spin up servers in the Tokyo datacenter. This would have been a nightmare proposition if I was still leasing physical servers. Having all my servers exist virtually in the cloud is a total win.

Graphical view of AWS datacenters
DhqjXNA.jpg



II. Free tier is tear free
So let's talk about a pretty amazing thing that Amazon has done that will help you. The Free Tier! Things that are free are very good. And this is exceptionally so with AWS. All combined, Amazon is giving away their service for a year to new users. If you had to pay for this stuff based on On-Demand pricing, it's over $60 a month in free stuff. Pretty cool. And they let you peek at just about every toy they have. For an entire year. For free. Real free, not some BS stuff where you get charged or whatever. Full Disclosure: You *could* get charged based on excessive usage, but even if that were the case, you'd have to work real hard to get a $10 bill every month.

There are many pieces that you can play with in the Free Tier. Today, we'll be talking about a single one of them. A virtual server that they term an EC2 (elastic cloud compute) instance. Lets get you started making your own cloud server.

First, start by signing up for an account here (http://aws.amazon.com/ec2/).

Next, you'll need to create some certificates to use for credentials. Amazon doesn't allow you to authenticate to your server with a username and password. Instead, they use certificate based security for additional security. This makes it easier for you, as you'll never have to enter a password to actually log into your server and no script kiddie will ever brute force your server before the sun goes super critical in about four billion years. Anyway, to create and get your new credentials, log into the AWS console (https://console.aws.amazon.com/console/home), select the link to the EC2 control panel, and select Key Pairs on the left side. Finally, click the Create Key Pair button, name it, and download it. Store this in a very safe place and remember it, as we'll need it later.

III. Cloudly with a chance of server
Now let's build your server. This part is retardedly simple. For this example, we're going to use Ubuntu 12.04 LTS server. I'm more of a CentOS fan myself, but the world is moving to Ubuntu if I like it or not. (/rant) So we'll head to the Marketplace and pick up a new server. The link to the EC2 image that is supported and managed by Ubuntu themselves is located here (https://aws.amazon.com/marketplace/pp/B007Z5YWX4). Click that link and hit the big Continue button on the right side. Here you'll be presented with a bunch of options. Select the following:
  • Version: This should auto-select the latest version. You shouldn't need to touch it
  • Region: Should be US East Virginia. I think this is the only datacenter that is included with the Free Tier. Either way, its the datacenter with the lowest cost out of all of them. Choose it.
  • EC2 Instance Type: This is important. A Micro instance is the only thing covered by the Free Tier program. It should be more than enough to cover your crappy little website. :p
  • VPC Settings: Ignore this for now. We'll discuss it in another article. Just know that if you're doing this for a real business, ALWAYS start by setting up a VPC.
  • Security group: You haven't made any yet, so select the option to create one based on the seller's settings
  • Key Pair: This is what you setup and downloaded earlier. You didn't lose it did you???
That's it. Just click the Launch with 1-Click. Almost as easy as buying a Kindle book, except you usually have to pay for those! In a couple of minutes, you will be the owner of your first cloud server. Congrats. Now let's connect to it. Hopefully you're already familiar with linux in general and Putty. If not, take some time right now to learn about it. I'll wait here...

Okay, so now you've learned linux and Putty. Great! Let's connect to your new instance. Remeber that .pem file that I asked you to download and not lose. Get it. Unfortunately, Putty doesn't know what to do with a .pem file, so we have to convert it to a format it knows. For that, we use Puttygen, which should have been installed when you installed Putty. Open Puttygen.
  • Under type of key to generate, select SSH-2 RSA.
    puttygen-key-type.png
  • Now click the load button. Choose all file types, find your .pem, and load it. Ignore the warnings.
    puttygen-load-key.png
  • Click save private key. Again you'll get a warning about setting a password. Set one if you want, but its more of a pain than its worth to me.
You now have a private key that Putty can use to connect to your instance. So let's finally get connected. Open Putty.
  • You'll need the hostname. Get that from logging into the EC2 console and selecting your new instance. The hostname will be something like 'ec2-11-22-33-44.compute-1.amazonaws.com'
  • In the hostname box, type [email protected] (using your real hostname idiot).
  • Make sure that the port is set for 22
  • Connection type should be SSH
  • In the Category pane, expand Connection, expand SSH, and then select Auth.
  • Now, in the right hand pane, select your .ppk file by hitting Browse under 'private key file for authentication'.
    putty-auth-config.png
  • Finally save your session. In the Category pane, select Session, enter a name under Saved Sessions and click Save
That's it. Now to connect to your brand new server, just hit the Open button. Initially, you'll get a warning about the SSH fingerprint. Accept that warning and you should be greeted with a prompt on your new box. If not, feel free to reply and I'll see what I can do to help.

IV. Wrapping it up
As a new owner of a cloud server, you're now a child of the future. There are many options available to you now. Maybe you'll want to install Wordpress (http://wordpress.org/) and start your own blog. Do you have your own domain name already and want email? Install Sendmail (http://www.sendmail.com/sm/open_source/) and run your own email server. Chat with friends while gaming with a Teamspeak (http://www.teamspeak.com/) server. Or hell, get crazy and make your own Reddit site using their open source software (https://github.com/reddit/reddit). There's a ton of stuff to play with. And the best part is that when you're done playing, delete it and start over if you want. Its all virtual, so none of it matters. Enjoy!