How-to guide

Schedule non-production environments on AWS

Learn how to put AWS non-production resources on a schedule: tag them, pick a scheduler, set stop and start times, and verify the savings.

By the Cloudverg engineering team · · 5 min read

Why this matters

Non-production environments sit idle for most of the week. A staging stack built for a Tuesday demo keeps its EC2 instances, RDS databases and ECS tasks running through the weekend. AWS charges for what runs, not what people use. A schedule turns that idle time into a predictable pattern: compute stops when the office closes, starts before the team logs on.

Storage keeps billing after a stop. EBS volumes, RDS storage, snapshots and Elastic IPs stay on the bill. Scheduling is not a full fix for waste, but it removes the largest variable line for many teams and makes the rest visible.

A schedule also reduces the blast radius of forgotten test systems. A dev box with an open security group is less exposed when it is stopped. Stopped resources cannot serve traffic or accept a login. The habit of tagging and scheduling forces teams to name an owner for each environment.

Watch the team impact. Developers in different time zones need overlap. CI pipelines that run at night need a start window or a separate always-on runner. Set the schedule around real work, not around a finance target.

Before you start

List what you plan to schedule and what you must leave alone. EC2 instances, RDS instances, Aurora clusters, ECS services, EKS node groups, Auto Scaling groups, Redshift clusters and SageMaker notebooks all have different stop behavior. A stopped EC2 instance keeps its EBS volumes. A stopped RDS instance restarts automatically after seven days.

Agree on tags. Use a consistent key such as Schedule with values like office-hours, weekdays or always-on. Add Environment, Owner and AutoStop. Tags are the contract between the scheduler and the resource. A resource without the tag should stay running by default.

Check dependencies before you stop anything. An EC2 application server may need its RDS database to shut down first. A NAT gateway or load balancer shared with other environments should not be stopped. CI/CD agents, bastion hosts and shared artifact stores often need to stay up.

Decide who can override the schedule and how. A simple approach is a tag change or a manual start in the console. Document the override so a late-night debug session does not turn into a permanent exception.

How to do it

Pick one scheduling tool and keep it boring. AWS Instance Scheduler deploys as a CloudFormation stack, stores schedules in DynamoDB and starts or stops resources based on tags. EventBridge Scheduler with a small Lambda function gives you more control but more code to own. Native scheduled actions work well for Auto Scaling groups and ECS service auto scaling.

Start with a single non-production account and a single schedule. Get the stop and start working for EC2 and RDS first. Add ECS, EKS and Redshift once the basics are stable. Roll out by environment, not by resource type, so you can test the whole stack together.

Write down the schedule in plain language before you touch cron. Office hours in the team time zone, a longer window for Monday morning, no stops during a release freeze. Then translate that into the tool. Keep the plain description in the repo next to the stack.

  1. Map the environment. Write down every resource in the stack, its owner and whether it can stop. Mark shared services and anything that must stay up.
  2. Set a tag standard. Apply Schedule=office-hours to resources that follow the weekday pattern. Add Environment and Owner. Leave production untagged or tag it Schedule=always-on.
  3. Choose the scheduler. For most teams, AWS Instance Scheduler is enough. It uses tags, supports multiple schedules and logs to CloudWatch. Build a Lambda option only if you need custom logic.
  4. Define stop and start times. Use a cron expression in the team time zone. Set start 30 minutes before the workday and stop 30 minutes after. Account for daylight saving if your region observes it.
  5. Order the shutdown. Stop application servers and ECS services before the database. Start the database first and wait for it to be available. Put a short delay between steps.
  6. Add exceptions. Create an always-on schedule for CI runners, shared directories, monitoring and shared artifact stores. Give developers a documented way to start a resource for a late session.
  7. Test in one account. Run the schedule for a week and watch the logs. Fix tag gaps before you copy the stack to other accounts.
  8. Roll out by account. Use CloudFormation StackSets or your IaC pipeline. Apply the same tags and schedule names so the logs stay readable.

How to check it worked

Check the resource state, not just the scheduler log. In the AWS console, confirm EC2 instances are stopped and RDS databases are stopped. For ECS, check the desired count. For EKS, check the node group size. A scheduler can report success while a resource ignores the call.

Watch CloudWatch metrics for the services you stopped. A stopped instance should stop sending CPU metrics. EventBridge and Lambda logs show failed invocations. Set an alarm on scheduler errors so a broken IAM role does not go unnoticed.

Use Cost Explorer or the Cost and Usage Report to compare a full week before and after. Filter by the non-production account and by service. Storage and data transfer will not drop as much as compute. That is expected.

Ask the team. A schedule that starts too late or stops during a deployment is worse than no schedule. Run a short retrospective after two weeks and adjust the window.

Mistakes to avoid

Scheduling by resource ID instead of tags. IDs change when a stack is rebuilt, and the new resource runs all night. The same goes for shared services such as NAT gateways, load balancers and CI runners. Keep them on an always-on schedule.

Stopping RDS and forgetting the seven-day restart. AWS restarts a stopped RDS instance after seven days to apply maintenance. If you stop it again, the cycle repeats. For long holidays, check the status or use a snapshot and delete pattern.

Stopping the database before the application. In-flight jobs fail and connection pools break. Define the order and test it. Start the database first and wait for it to be available before you start the app.

Treating the schedule as a full cost fix. Storage, snapshots, idle load balancers and data transfer still bill. A schedule is one control. If you want a ranked view of the rest, Cloudverg's Cloud cost audit at $4,500/month is one option among others, next to doing the review in-house or with another firm.

Frequently asked questions

Does stopping an EC2 instance stop all charges?

No. Compute charges stop, but EBS volumes, Elastic IP addresses and snapshots keep billing. You also pay for any load balancer or NAT gateway that stays up. Check those shared resources before you call the environment free.

Can I schedule RDS to stop at night?

Yes, for supported engines. A stopped RDS instance restarts automatically after seven days, so a nightly stop and morning start works, but a long holiday shutdown needs a check. Aurora clusters have their own stop behavior and limits.

How do I schedule ECS and EKS environments?

For ECS, scale the service desired count to zero and back. For EKS, scale the managed node group to zero or use Karpenter consolidation. Keep the control plane running unless you delete the cluster, since the control plane has its own charge.

Monthly plan

Want help with this? Cloud cost audit

$4,500/month

2 weeks · Starts within 10 business days

A two-week, read-only review of your AWS, Azure, Google Cloud or Oracle bill, with every saving ranked by dollars per month.

Renews monthly. Cancel any time.
What is included

Related guides

More cloud costs guides   Cloud cost audit

Smallest way to start

Get a senior architect on your problem this week

Ninety minutes a month on the cloud, AI or security question that is blocking you, a pre-read of your material and a written summary within two business days.

$450/month

Renews monthly. Cancel any time.