How to Find the DB Instance ID from an RDS Resource ID
- Emily

- Jun 12
- 1 min read
Problem Overview
If you only know an RDS Resource ID, it is hard to find the DB instance on the Management Console because if you search for a DB instance using the RDS Resource ID in the search bar, the target DB instance doesn't show up in the results.

You can check the Resource ID at the "Configuration" tab on the Management Console, however when there are a large number of DB instances, checking them one by one is very tedious.

How to Address This Issue
You can use the describe-db-instances command to find the DB Instance ID from the RDS Resource ID:
$ aws rds describe-db-instances \
--filters Name=dbi-resource-id,Values=db-7JGKXXXXXXXXXXXXXXXXXXXXXX \
--query 'DBInstances[].[DBInstanceIdentifier,DbiResourceId]' \
--output text
database-test-instance-1 db-7JGKXXXXXXXXXXXXXXXXXXXXXX ⭐️ResultIf you'd like to find the DB Cluster ID, you can use the describe-db-clusters command in the same way.
$ aws rds describe-db-clusters \
--query 'DBClusters[].{DBClusterIdentifier:DBClusterIdentifier,DbClusterResourceId:DbClusterResourceId}' \
--output text
database-test cluster-BTN2XXXXXXXXXXXXXXXXXXXXXX ⭐️Result


Comments