Skip to content
Toggle your EC2 instance to start or stop without have to configure and mantain cron jobs
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
light_switch
tests
.gitignore
.travis.yml
Makefile
README.md
app.py
instances.json.default
requirements.txt
serverless.yml
setup.py

README.md

Light Switch Travis Status Coverage Status

Toggle your EC2 instance to start or stop without have 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 turned off regularly.
This project is a simple serverless application prepread to run with AWS Lambda

How it Works

The application will look for instances ids in instances.json file. With these instances 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.

Instances file

Configure your instances ids in instances.json. See example in 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
You can’t perform that action at this time.