How do I automatically stop an RDS database outside business hours?
Put a dev or staging Amazon RDS database to sleep at night and on weekends, start it again before work, and verify the result with the AWS CLI.
Short answer
Connect the AWS account with the SnoozeDB CloudFormation role, move the database from To triage to Managed resources, then assign the Business Hours schedule in your team's IANA timezone. Outside the active window the scheduler calls
rds:StopDBInstance; inside it, rds:StartDBInstance. With 8:00–20:00 Monday to Friday, the instance runs 60 of 168 weekly hours, which removes about 64% of its on-demand instance cost.When this applies
- Development, staging, QA, and demo RDS DB instances that nobody uses at night or on weekends.
- Standard RDS DB instances. SnoozeDB never schedules Aurora or Multi-AZ DB cluster members; they stay Protected.
- Not production. Keep production databases Protected (see the guide on protecting production).
AWS cannot stop every instance. For example, an instance that is a read replica, or that has one, cannot be stopped. Check the AWS limitations for stopping a DB instance before you plan savings.
Steps
- Create a SnoozeDB workspace. The free Dev plan manages one RDS database.
- Open Cloud integrations, enter the 12-digit AWS account ID, and deploy the generated CloudFormation stack. It creates the
SnoozeDBAccessRoleIAM role, which SnoozeDB assumes through AWS STS with a unique External ID. No access keys are shared. - Run Sync Now. New databases appear in To triage; nothing is scheduled until you decide.
- Choose Manage on the staging database to move it to Managed resources.
- Assign Business Hours and check the timezone, for example
Europe/Paris. Daylight saving time changes are handled automatically.
Monday to Friday 08:00 ---- running ---- 20:00
20:00 ---- stopped ---- 08:00
Saturday, Sunday stopped all dayVerify the result
After the first stop window, check the instance status from a terminal with read access to the account:
aws rds describe-db-instances \
--db-instance-identifier staging-db \
--query 'DBInstances[0].DBInstanceStatus' \
--output text
# "stopped" outside the active window, "available" inside itEach start and stop also appears in SnoozeDB Activity Logs, including skipped and failed actions.
Estimate the savings
Running hours: 12 h x 5 days = 60 h per week
Stopped hours: 168 h - 60 h = 108 h per week (about 64%)
Monthly hours stopped: 108 x 52 / 12 = 468 h
db.t3.medium at $0.068/h (example on-demand rate): 468 x 0.068 = about $31.80 saved per monthWhat still bills while stopped
AWS keeps charging for provisioned storage, Provisioned IOPS, backup storage, and any public IPv4 address. Only instance hours stop. Use Cost Explorer for actual amounts.
If nothing happens at the expected time
- The database is in Managed resources, not To triage or Protected.
- The schedule timezone, weekdays, start time, and stop time are the ones you expect.
- The database is not locked and has no active temporary start.
- Activity Logs show a skipped, failed, or successful action at the boundary.
- Run a sync if the status in SnoozeDB no longer matches the AWS console.