AWS / CloudWatch

Find your least-used AWS databases with CloudWatch

Every account has a database created for a demo or a test that nobody remembers. It still bills every hour. CloudWatch already holds the evidence that nobody uses it, if you read the right metric and know when the data cannot decide.

Connections, not CPU, for databases

An idle database still uses some CPU: background processes, replication, backups, statistics collection. A CPU threshold low enough to ignore that noise is also low enough to miss a lightly used database. CPU alone does not separate "nobody uses it" from "one person queries it twice a day".

Connections do. DatabaseConnections in the AWS/RDS namespace counts client sessions. If its maximum stays at zero for a week, no application, script or person connected during that week. For EC2 there is no equivalent, so CPU is the practical signal.

ResourceMetricStatisticActive hour from
RDS DB instanceAWS/RDS DatabaseConnectionsMaximum per hour1 connection
EC2 instanceAWS/EC2 CPUUtilizationAverage per hour5% CPU

Use the hourly maximum for connections. An average hides a short session: one connection for ten minutes averages to a fraction over the hour. The maximum records it.

Read it yourself

For one database, the AWS CLI returns a week of hourly maximums:

aws cloudwatch get-metric-statistics \
  --namespace AWS/RDS --metric-name DatabaseConnections \
  --dimensions Name=DBInstanceIdentifier,Value=staging-db \
  --statistics Maximum --period 3600 \
  --start-time 2026-11-27T00:00:00Z --end-time 2026-12-04T00:00:00Z

Count the hours with data, then the hours where the maximum reached 1. A database with data for every hour and no hour at 1 is a candidate. Repeat per database, per account and per region, and keep the window long enough to cover a full week: a database used only for a Friday release looks idle from Monday to Thursday.

The reading needs only cloudwatch:GetMetricData or GetMetricStatistics. It never connects to the database or reads its contents.

When the data cannot decide

Zero connections is evidence. No data is not. Keep the two apart, or a cleanup list will contain databases you know nothing about.

  • No datapoints at all. A stopped instance does not publish these metrics, so a database stopped for the whole window has no data. That says nothing about whether it is used when it runs.
  • Access denied. If the role cannot read CloudWatch, the answer is unknown, not zero.
  • Incomplete reads. A paginated read that stops early leaves hours missing. Treat it as unknown rather than counting the missing hours as idle.
  • Connections that do no work. A connection pooler or a monitoring agent that keeps a session open makes the database look used. Zero connections is reliable; a constant single connection deserves a look before you decide either way.

A low score is a reason to ask the owner, not to delete. Before removing anything, take a final snapshot and check its cost in the RDS snapshot guide.

The Least-used resources block in SnoozeDB

The Metrics page in SnoozeDB runs this analysis on demand for the RDS databases and standalone EC2 instances in your inventory, across your connected accounts and regions. EKS workers and Auto Scaling instances are left out. It reads CloudWatch through the cross-account role when you click Analyze; the optional Activity metrics module grants cloudwatch:GetMetricData.

  • Choose 24 hours, 48 hours, one week, one month, or a custom UTC range from 1 hour to 31 days. Filter by account, region, type or tag, up to 100 resources per analysis.
  • For each resource, the table shows the hours with data, the hours that reached the threshold (1 connection for RDS, 5% CPU for EC2), and the peak. Resources with no active hour are marked Unused and listed first.
  • Resources with no metric and unreadable resources are counted apart, never ranked as unused. Each unreadable one gives its reason: permission denied, read failed, incomplete or unsupported.

The block is a reading, not an action. Once you know which databases sit idle, give the ones you keep a schedule, as described in how to stop RDS automatically, and ask the owners about the rest.

The same thresholds drive SnoozeDB's optional idle alerts in Slack, which watch managed resources and propose hibernation when nobody uses them. The savings and reports guide describes the Metrics page in full.