This lambda is Stop and Start RDS, EC2 and ECS services based in TAG defined
EC2 accept json or list format
- Monday - Friday
JSON Format
{"workday": {"start": 8, "stop": 22}}
List Format
workday_start=8 workday_stop=22
RDS only list format is accepted
- Thursday
List Format
thu_start=7 thu_stop=19
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
In order to deploy the lambda to the Client, it is necessary to have awscli configured with the Secret Keys of the Client account.
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
Install plugins serverless framework
serverless plugin install -n serverless-python-requirements --stage prod
serverless deploy --stage prod
serverless remove --stage prod