Home > ec2-scripts

ec2-scripts

Ec2-scripts is a project mainly written in RUBY and SHELL, it's free.

Command-line tools for managing EC2 resources @ Gluster

================== EC2 Scripts README

This repository contains a set of convenience scripts to manage AWS resources at Gluster.


Source

The github repository for this scripts is: https://github.com/vikasgorur/ec2-scripts


Setup

The tools require Ruby (>= 1.8.7) to be installed, along with the following Ruby gems: amazon-ec2 (https://github.com/grempe/amazon-ec2)

gem update --system

gem install amazon-ec2

The tools also require that two environment variables be set:

export AMAZON_ACCESS_KEY_ID= export AMAZON_SECRET_ACCESS_KEY=

These should be set to your AWS API access keys.


Usage


Commands

Create a spot instance:

Usage: create-spot-instance -k KEY -o OWNER [-t TYPE] [-z ZONE] [-g GROUP] [-e DAYS] [-m ADDR] NAME -k, --key KEY SSH key name for the instance -o, --owner OWNER Owner of the instance -t, --type TYPE Type of the instance (default: m1.large) -z, --zone ZONE Availability zone for the instance -g, --group GROUP Security group (default: 'default') -e, --expires DAYS Expiration period for the instance (in days) -m, --mail ADDRESS E-mail address for reminders

The expiration period and reminder email address are needed for aws-cop to enforce them. If no such enforcement is needed in your AWS account, you can choose to not specify them.

Terminate an instance:

Usage: terminate-instance -o OWNER NAME -o, --owner OWNER Owner of the instance

List instances:

Usage: list-instances [-o ] -o, --owner OWNER Show only instances belonging to given owner -e, --expired Show only expired instances

Modify expiry date:

Usage: modify-expiry-date -o OWNER [-p N] [-m N] NAME -p, --plus N Add N days to the expiry date -m, --minus N Subtract N days from the expiry date -o, --owner OWNER Owner of the instance


Contact

Questions, comments, patches, beer: Vikas Gorur [email protected]