How to list AWS RDS instances that are stopped

Viewed 4020

I'm trying to use the AWS CLI to list all the AWS RDS instances that I have that are in a Stopped status.

It's possible with EC2 with aws ec2 describe-instances and adding a filter --filters "Name=instance-state-name,Values=stopped".

However, with aws rds describe-db-instances, I do not find an equivalent. There is a --filter option, but only had the following options as filters: db-cluster-id, db-instance-id, dbi-resource-id, domain, engine.

So what AWS CLI command can I use to list all the RDS instances that are currently Stopped (Status=stopped)?

2 Answers

You can do something like this:

aws rds describe-db-instances --query 'DBInstances[].DBInstanceStatus[]'

output:

[
   "available"
]
Related