Our dev and test EC2 and RDS instances can sit idle overnight. What are practical ways to schedule them without a dedicated FinOps person, especially when someone needs access after hours?
How do you handle idle dev and test resources in AWS?
Answers
A fixed schedule plus an after-hours start option is a pretty straightforward setup. AWS Instance Scheduler can handle the regular hours, while a small internal Lambda endpoint can start an instance and its associated database when someone needs them.
You can leave the resources running until the next scheduled stop rather than building a separate timer for every request. Restrict who can call the endpoint and which resources it can start.
Reply to this answer
Keep the controls close to the deployment if working hours vary by developer. EventBridge Scheduler can be deployed with the rest of a CDK app, with schedules configured for each dev environment.
That gives people predictable access without relying on someone to remember Friday shutdowns. You still need to account for jobs that run outside those hours.
Reply to this answer
For EC2, a simple nightly shutdown Lambda driven by tags can work. Give developers a small CLI wrapper to list, start, stop and tag their dev instances, including a way to mark one that needs to stay on overnight.
Be careful with the tag convention. If a tag gets renamed or omitted, the shutdown logic may miss a machine or stop the wrong one.
Reply to this answer
RDS needs its own checks. A stopped DB instance can be restarted automatically after seven days, so don't assume a one-time stop will cover a long break. A scheduled workflow using the RDS CLI is another option if you don't want a separate scheduler service.
Check the likely savings before spending a lot of time on automation. Not every dev database costs enough while idle to justify a complicated setup.
Reply to this answer
If usage is irregular, a fixed clock schedule might not fit. Another option is to shut staging resources down based on signals like low CPU or no traffic, then offer a way to start them when needed.
That's more involved, particularly if overnight data-loading jobs need those resources. Rightsizing recommendations from Compute Optimizer can also help reduce costs while instances are running, but they don't replace shutdown scheduling.
Reply to this answer
Add your answer
Answers are reviewed before publication.
p.713+bracketwinder:
An explicit keep-on tag makes leaving an instance running a deliberate choice rather than the default.