0.0
No commit activity in last 3 years
No release in over 3 years
A tool for creating new Amazon EC2 instances. It allows you to organize your instances by projects and environments.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.9.15
>= 2.0.0.beta.20
>= 1.16.2
 Project Readme

amazon-instance

amazon-instance is a tool for creating new Amazon EC2 instances. It allows you to organize your instances
by projects and environments.

Installation

gem install amazon-instance

Configuration

The configuration directory has got the following structure:


  config/
    general.yml
    projects/
      example.yml
      example2.yml
      ..
    on-boot/
      script.sh
      script2.sh
      ..

general.yml

This file includes the basic configuration.


access_key_id: YOUR_ACCESS_KEY
secret_key_id: YOUR_SECRET_KEY
ec2_zone_url:  https://eu-west-1.ec2.amazonaws.com

projects/

Each file defines a particular project. Instance options such as AMI id, type, … should be provided here.
This files are organized by environments. For example, if we want to setup a project called “my-personal-site”
with two environments (development and production), we could do something like this:

my-personal-site.yml

development:
  :key_name:          mykeys
  :availability_zone: eu-west-1a
  :instance_type:     m1.small
  :security_group:    my-project-development-web
  :image_id:          ami-52794c26
  :on_boot:           script.sh

production:
:key_name: mykeys
:availability_zone: eu-west-1a
:instance_type: m1.small
:security_group: my-project-production-web
:image_id: ami-52794c26
:on_boot: script.sh

Notice that we are saying that we want to run script.sh once the instance is created. This script should be
placed into the on-boot directory.

Usage

You can launch new Amazon EC2 instances by using the command amazon-instance


alfonso@alexandra:~$ amazon-instance -h
Options:
  --environment, -e <s>:   Environment (Required)
      --project, -p <s>:   Project (Required)
   --config-dir, -c <s>:   Config directory (optional)
            --quiet, -q:   Quiet mode (optional)
             --help, -h:   Show this message

For example:

alfonso@alexandra:~$ amazon-instance -p my-project -e development

License

See LICENSE for details