Skip to content

Instantly share code, notes, and snippets.

@albarki
Created July 7, 2018 21:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albarki/3588354ef11a137e199e29381fb07de1 to your computer and use it in GitHub Desktop.
Save albarki/3588354ef11a137e199e29381fb07de1 to your computer and use it in GitHub Desktop.
Get List of RDS instances from All regions
for region in `aws ec2 describe-regions --output text | cut -f3`
do
echo -e "\nListing RDS in region:'$region'..."
aws rds describe-db-instances \
--region $region \
--query 'DBInstances[*].[DBInstanceIdentifier,ReadReplicaDBInstanceIdentifiers]'
done
@luebken
Copy link

luebken commented Dec 20, 2021

Thanks for the script. I had to cut it to column 4

for region in `aws ec2 describe-regions --output text | cut -f4` 
do
echo -e "\nListing RDS in region:'$region'..."
aws rds describe-db-instances \
	--region $region \
	--query 'DBInstances[*].[DBInstanceIdentifier,ReadReplicaDBInstanceIdentifiers]' 
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment