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
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.
- AWS
- Python 3.6
- Serverless
Configure your env vars in serverless.yml
file in custom
section.
The schedule configuration is also in serverless.yml
file.
Configure your EC2 instances ids in instances.json
. See example in instances.json.default
Configure your RDS instances ids in rds_instances.json
. See example in rds_instances.json.default
npm install -g serverless
sls deploy
Obs.: You must configure your credentials to work with serverless
.
make tests
- Prepare for others cloud services