AWS automation

How to stop and start EC2 instances automatically

For a development or staging instance, the simplest saving is often fewer running hours. The useful work is not writing the start and stop call. It is making sure the right resources are included and the wrong ones are not.

Before you automate

  • Confirm that the instance is non-production and has a known owner.
  • Check the root volume and any data that does not persist after a stop.
  • Document dependencies, start-up time, and a manual override path.
  • Start with a small reviewed group before scheduling a whole account.

Know what a stop changes

AWS distinguishes EBS-backed and instance-store-backed instances. An EBS-backed instance can be stopped and started. When an instance starts, it can run on a new underlying host and receive a new public IPv4 address. Treat that as a real application change to test, rather than an implementation detail to ignore.

A stopped instance may no longer incur its running compute charge, but attached storage and other AWS services can still have costs. Scheduling is one cost control, not a complete bill-management system.

Choose the operating model

AWS offers several ways to schedule EC2. Systems Manager Quick Setup Resource Scheduler targets tagged instances. Instance Scheduler on AWS deploys an AWS-managed reference architecture. A custom Lambda and EventBridge flow is also possible when the scope is small and a team owns the code.

SnoozeDB is the focused option when the operational need is a reviewed scheduling workflow for selected RDS and EC2 resources, rather than another scheduler deployment to maintain.

Use tags, but do not trust them blindly

Tags make selection manageable, but a tag typo or a copied value can put an unintended instance in scope. Use explicit environment tags, keep production on a deny path, and give each eligible resource an owner. Review the current inventory before activating a schedule and after making bulk infrastructure changes.

For a comparison of the available approaches, read AWS instance scheduling tools and Instance Scheduler versus Cloud Custodian versus SnoozeDB.

A safe rollout

Pick one low-risk instance, schedule one off-hours window, and observe a full stop and start cycle. Check health checks, private and public addresses, application dependencies, background jobs, and any alerts that should be quiet overnight. Only then add the next group of resources.

Review EC2 resources before scheduling them

Connect an AWS account, inspect the inventory, and activate only the RDS and EC2 resources that are safe to manage.

Connect AWS

Frequently asked questions

Can I stop every EC2 instance on a schedule?

No. Only schedule resources whose availability requirements permit it. Start with development, demo, test, and staging instances after confirming their dependencies and recovery path.

What happens when I stop an EC2 instance?

An EBS-backed instance can be stopped and started again. AWS notes that an instance-store root volume cannot be stopped and started, and data on instance-store volumes is erased when an instance stops.

Can AWS automate EC2 start and stop?

Yes. AWS documents Instance Scheduler on AWS, Systems Manager Quick Setup Resource Scheduler, and a Lambda plus EventBridge implementation as options.