Stop dev and test environments at night, and let developers wake them up themselves
Most non-production EC2 instances, RDS databases and Auto Scaling groups run 168 hours a week and are used for about 50. Tag-based stop scripts work until someone needs a box at 9 pm and has to ask ops, or until RDS starts itself again after 7 days stopped. Connect an AWS account with one CloudFormation stack, tag what may be scheduled, and we stop it outside the hours you set, start it again in the morning, and give your team a wake link and a Slack command for the evenings.
What it does
- Schedules with a timezone, weekdays and hours, overnight periods and a holiday list. Daylight saving time is handled.
- EC2 instances, RDS instances, Aurora clusters and Auto Scaling groups (sizes saved, set to 0, restored on start).
- Self-service wake-up: a link and a Slack slash command start a schedule for 2 h, 4 h or until 9:00 tomorrow, with the requester's name. It stops again by itself. An approver is optional.
- RDS re-stop: when AWS starts a database again after 7 days, it is stopped again and logged.
- A notice 15 minutes before each stop on Slack or email, with a "skip tonight" link.
- Weekly savings report: hours stopped times the on-demand price, or hours only when we do not know the price.
Safety
- The role can only start and stop resources that carry the tag
puzari-offhours=managed. Untagged resources can never be touched, even by mistake: AWS refuses the call. - Every new schedule starts in dry run: the log shows what would happen until you switch it on.
- Resources tagged
puzari-offhours-skipare never stopped. Databases with a pending reboot or near their backup window are held and logged. - Every action is logged with who, what and when, and can be downloaded as CSV.
Read the guide: how to do this yourself with native tools
Nothing to deploy in your account except one IAM role. No Lambda, no DynamoDB, no extra AWS bill.