Skip to content

lohanbodevan/light-switch

Repository files navigation

Light Switch Travis Status Coverage Status

Toggle your EC2 and RDS instances to start or stop without having to configure and mantain cron jobs.
The goal of this project is to provide some automation for instances that have to be turned on and off regularly (eg. development or staging envinronments).
This project is a simple serverless application prepread to run with AWS Lambda

How it Works

This application will look for EC2 instances ids in instances.json and RDS instaces ids in rds_instances.json file. With these ids, the application will
get each instance state and change to the oposite.
For example, if the instance state is running the application will change to stopped based on a schedule previously configured.

Cloud Services Available

  • AWS

Requirements

Configurations

Env vars

Configure your env vars in serverless.yml file in custom section.
The schedule configuration is also in serverless.yml file.

EC2 Instances file

Configure your EC2 instances ids in instances.json. See example in instances.json.default

RDS Instances file

Configure your RDS instances ids in rds_instances.json. See example in rds_instances.json.default

Using Serverless

Install

npm install -g serverless

Deploy to Cloud

sls deploy

Obs.: You must configure your credentials to work with serverless.

Run tests

make tests

TODO

  • Prepare for others cloud services

About

Toggle your EC2 instance to start or stop without have to configure and mantain cron jobs

Resources

Stars

Watchers

Forks

Packages

No packages published