Skip to content

afonsoavr/aws-schedule-instances

 
 

Repository files navigation

Schedule Instances

This lambda is Stop and Start RDS, EC2 and ECS services based in TAG defined

Schedules Example

EC2

EC2 accept json or list format

  • Monday - Friday

JSON Format

{"workday": {"start": 8, "stop": 22}}

List Format

workday_start=8 workday_stop=22

RDS

RDS only list format is accepted

  • Thursday

List Format

thu_start=7 thu_stop=19

ECS

ECS only list format is accepted

List Format

daily_start=8 daily_stop=20 daily_stop-desired=1

If desired is 0, then daily_stop-desired can be removed

daily_start=8 daily_stop=20

Deploy

In order to deploy the lambda to the Client, it is necessary to have awscli configured with the Secret Keys of the Client account.

Configure file .env

Create copy of file .env.example like .env.prod

cp .env.example .env.prod

Change the env for the Client who will Deploy the function if necessary

Dependencies

Install plugins serverless framework

serverless plugin install -n serverless-python-requirements --stage prod

Deploy

serverless deploy --stage prod

Remove

serverless remove --stage prod

About

Schedule Start and Stop EC2 or RDS instances

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Shell 0.4%