kickstarter/build-ubuntu-ami — pull request #2 by mluckeneder (2012-11-06 21:17:35+00:00)
Title: Feature/aws key

When I build the gem from the Github source and try to run it using `build-ubuntu-ami`
I get the following error message:
```
~/code/build-ubuntu-ami[master]% build-ubuntu-ami examples/custom.sh
Configuration:
region: us-east-1
flavor: m1.small
brand: My
size: 20
codename: lucid
key_name: default
group: default
arch: amd64
canonical ami: ami-c7b202ae
kernel: aki-427d952b
description: My-lucid-amd64-20121106-2113
Launching server...
/Users/michael/.rvm/gems/ruby-1.9.3-p194/gems/fog-1.7.0/lib/fog/core/service.rb:208:in `validate_options': Missing required arguments: aws_access_key_id, aws_secret_access_key (ArgumentError)
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/gems/fog-1.7.0/lib/fog/core/service.rb:58:in `new'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/gems/fog-1.7.0/lib/fog/compute.rb:15:in `new'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/gems/fog-1.7.0/lib/fog/compute.rb:5:in `[]'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/gems/build-ubuntu-ami-0.1.0/lib/build_ubuntu_ami.rb:93:in `launch_server!'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/gems/build-ubuntu-ami-0.1.0/lib/build_ubuntu_ami.rb:137:in `build!'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/gems/build-ubuntu-ami-0.1.0/bin/build-ubuntu-ami:32:in `'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/bin/build-ubuntu-ami:19:in `load'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/bin/build-ubuntu-ami:19:in `

'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/michael/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `

'
```

I figured that this is due to the fact that `aws_access_key_id` and `aws_secret_access_key` are never specified in the script. I therefore added the command line options `---aws_access_key_id` and `--aws_secret_access_key` so that these values can be passed into the library at runtime like this:

```
build-ubuntu-ami --aws_access_key_id=MY_AWS_ACCESS_KEY_ID --aws_secrect_access_key=MY_AWS_SECRET_ACCESS_KEY my_script.sh
```