« Kevin Ngo

Amazon EC2 Instance and Puppet

9 Mar 2012

I finally took the splurge on an AWS micro EC2 (Elastic Cloud Compute) instance. Well, it wasn’t really a splurge since I created a new Amazon account to qualify for their one-year free usage tier.

The meat of the AWS Free Usage Tier (per month):

After the period is over (which I may then create another new account), a Micro instance is $.020 per hour, and the EBS volumes are $.10 per GB per month. Not bad at all especially with the recent price drops. Linode was another option, but they had me playing Goldilocks; they offered a few fixed options that were either not enough or too much. Amazon on the flip side is pay-as-you-go (and of course a free year). Perhaps if I used my instance enough, they’ll forget about charging me like they did with my Amazon Prime account that has been good and free since forever.

I found this to be a good chance to practice my Puppet-eering. A month ago, I started a Git repository for what meant to be my Puppet manifests, but I never got around to it. Though with some help from limed and Playdoh’s Puppet template, I found a nice structure for my Puppet files and manifests.

|-- files
|   |-- etc
|   |   |-- apache2
|   |   |   |-- sites-enabled
|   |   |       |-- ngokevin.conf
|   |   |-- vim
|   |       |-- vimrc
|   |-- home
|       |-- bashrc
|       |-- beetsconfig
|-- manifests
|   |-- classes
|   |   |-- apache2.pp
|   |   |-- apt.pp
|   |   |-- bash.pp
|   |   |-- beets.pp
|   |   |-- git.pp
|   |   |-- init.pp
|   |   |-- ngokevin.pp
|   |   |-- python.pp
|   |   |-- subsonic.pp
|   |   |-- tzdata.pp
|   |   |-- vim.pp
|   |   |-- wok.pp
|   |-- puppet-ngokevin.pp
|-- pip

I had puppet-ngokevin.pp act as the main manifest, defining parameters and specifying the order in which classes are applied. And it’s smooth sailing from there: bring in configs, install packages, and set up this site. A successful Puppet apply is like rolling a d20. After that, I just pointed my domain name towards the public DNS of my instance, and to the Internet it goes. Next, I need to get a ~30gB EBS volume to store my music for some Subsonic goodness.

I can finally put to rest my home server that’s running under a desk in Portland. You’ve done well, friend.