How to shut down AWS dev and test environments out of hours
The short answer
Tag non-production resources with a schedule, then stop and start them on that schedule using EventBridge with Lambda, AWS Instance Scheduler, or a policy engine. A standard weekday-only schedule removes roughly two thirds of the billed hours from those environments, provided engineers have a self-service way to override it.
A working week is about 50 hours. A calendar week is 168. Non-production environments are usually sized for the first number and billed for the second.
What actually stops
Not everything can be stopped, and knowing which is which prevents an embarrassing first run.
| Resource | Out of hours |
|---|---|
| EC2 instances | Stop. You keep paying for attached EBS. |
| RDS instances | Stop, but AWS restarts them after 7 days. |
| Auto Scaling groups | Scale to zero, or suspend the group. |
| ECS / EKS workloads | Scale the service or node group down. |
| NAT gateways | Delete and recreate, if you want the saving badly enough. |
TODO — verify each row against current AWS behaviour before publishing, and add the services specific to your clients’ estates.
Getting the schedule right
The failure mode is not technical, it is social. Shut down an environment while somebody is using it and the schedule gets switched off permanently the next morning — usually by the person you most needed on side.
Three things prevent that:
- An override anyone can use. A tag, a Slack command, a button. If keeping an environment up at 2am takes a ticket, the schedule loses.
- Warning before shutdown. A message into the team channel fifteen minutes before.
- Timezones and holidays. A schedule set in UTC will surprise a team in Sydney exactly once.
TODO — expand with the schedule tag format you use, and a worked example of the override.
What it is worth
Whatever your non-production spend is, a weekday-only schedule takes out roughly two thirds of the billed hours on everything that can be stopped. We are not going to put a number on that for your estate here, because it depends entirely on how much of your spend is non-production and how much of that is stoppable — which is one of the things the audit measures.