Skip to content

Instantly share code, notes, and snippets.

@rpetre
Created September 18, 2012 22:24
Show Gist options
  • Select an option

  • Save rpetre/3746346 to your computer and use it in GitHub Desktop.

Select an option

Save rpetre/3746346 to your computer and use it in GitHub Desktop.
Debian AMI building howto
For starters, you need an AWS account (not really getting into detail here, you only need a valid credit card for that with at least a couple of bucks on it). Make sure you sign on for EC2 and IAM at least.
In the IAM console I added a 'debuild' user, with permissions for everything ec2, made a key and cert for it (TODO: figure out finer-grained permissions, if possible).
Start some Linux instance in the region you want (I operate on eu-west-1, for now). Get root on it. mkdir /root/ec2 , go there.
wget http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip and http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip, unzip both of them.
Download https://github.com/andsens/ec2debian-build-ami/tarball/master, untar it. get the environment script at the end of README.md in a file and edit it. For the private cert and key, get the ones made for the debuild IAM user. AWS_USER_ID is actually the username (for a IAM user).
source the env file ( with '.')
You can now run the ec2debian-build-ami (you may want to try --help first).
(My preference is to edit plugins/standard-packages-tasks/add-standard-packages and add a bunch of packages, then add --plugin plugins/standard-packages-tasks to the command line)
When it's done it'll publish the AMI as something like debian-squeeze-amd64-YYYYMMDD (by default), you'll find it in the AMI list (with ec2-describe-images -o self, for instance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment