0.0
No commit activity in last 3 years
No release in over 3 years
This gem starts multi ec2 instances, and stops them if you command.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
>= 0

Runtime

 Project Readme

MultiEc2Kiq

This gem starts multi ec2 instances, and stops them if you command.

Description

This has two methods, "start" and "start_wait_until_stop". Below are the methods.

  • start
    "start" allows you to start ec2 instances that defined in yml file that as settings.

  • start_wait_until_stop
    "start_wait_until_stop" allows you to start ec2 instances, then it waits until you command to stop then stop them.
    After ec2 instances start, it registers ec2 "started" status in Dynamodb table.
    If you want to command ec2 stop, you have to update above status to "to_stop", then it stops the ec2.
    After ec2 stopped, it registers ec2 "stopped" status.

Installation

Add this line to your application's Gemfile:

gem 'multi_ec2_kiq'

And then execute:

$ bundle

Or install it yourself as:

$ gem install multi_ec2_kiq

Usage

You have to set aws profile in your ~/.aws/credentials.

Write configuration yml file, use "lib/settings.yml" as a reference.

To create ec2-status-table on DynamoDB, you have to call create_status_table method from rails console, ruby source, e.t.c.

    require "multi_ec2_kiq"

    include MultiEc2Kiq

    MultiEc2Kiq.config_path = File.expand_path("your configuration file path", __FILE__)
    MultiEc2Kiq.create_status_table

Then, call methods.

    require "multi_ec2_kiq"

    include MultiEc2Kiq

    MultiEc2Kiq.config_path = File.expand_path("your configuration file path", __FILE__)
    MultiEc2Kiq.start
    require "multi_ec2_kiq"

    include MultiEc2Kiq

    MultiEc2Kiq.config_path = File.expand_path("your configuration file path", __FILE__)
    MultiEc2Kiq.start_wait_until_stop