Project

awsm

0.0
No commit activity in last 3 years
No release in over 3 years
If you work with AWS, then Awsm wants to help make your life easier. Spin up/down ad-hoc instances as easily as `awsm spin up my_project`. Native ruby config file!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 0.10

Runtime

~> 0.19
 Project Readme

Awsm

Awsm is an awesome AWS querying tool. Pun most certainly intended.

Install from RubyGems

Awsm is available on RubyGems, to install it, all you need to do is:

gem install awsm

Install from Source

Awsm is written in Ruby 2.1, so you'll need that to start with, you'll also need the bundler gem.

[you@host:~]$ git clone https://github.com/mduk/awsm
[you@host:~]$ cd awsm
[you@host:~/awsm]$ bundle install
[you@host:~/awsm]$ gem build awsm.gemspec
[you@host:~/awsm]$ gem install awsm-x.x.x.gem
[you@host:~/awsm]$ awsm

Running Awsm

Awsm requires three enviornment variables to be set in order to work. I use something like this:

#!/bin/bash

export AWS_ACCESS_KEY_ID="You do not leak keys on github."
export AWS_SECRET_ACCESS_KEY="You DO, NOT, LEAK, keys on github!"
export AWS_REGION="eu-west-1"

echo -e "\033[1m\033[92mAWS Environment Set.\033[0m"

Configuring Awsm

Awsm will read configuration from ~/.awsm.rb. An example ~/.awsm.rb file is shown below:

Awsm::configure do |c|

  c.table :instance do |c|

    # Define which fields to display in an instance table and in what order
    c.use_fields [ :environment, :name, :instance_id, :image_id, :launch_time, :state, :private_ip ]

    # Add a custom field. Name, Heading, Block (extracts field value from instance object)
    c.add_field :environment, 'Environment' do |i|
      i.tags.find { |t| t.key == 'myapp:environment' }.value
    end

  end

  c.table :image do |c|
    c.use_fields [ :image_id, :name, :creation_date ]
  end

  c.dns do |c|
    c.hosted_zone '/hostedzone/somethingorother'
  end

  # Default Instance Parameters
  c.spin do |c|
    c.instance_type 't2.micro'
    c.key_name 'my-key'
    c.subnet 'subnet-a0b1c2d3'
    c.security_group 'sg-a0b1c2d3'
    c.tag 'h2g2:contact', 'ford.prefect@megadodo.h2g2'
    c.tag 'h2g2:planet', 'kakrafoon'
  end

  # Preset: mything
  c.spin 'mything' do |c|
    c.image_id 'ami-a0b1c2d3'
    c.security_group 'sg-a1b2c3d4'
    c.tag 'thing:environment', 'dev'
  end

end

Licence

See LICENCE.txt file.