1

I've created few different instances, one instance is of Amazon Aurora PostgreSQL and other instances are of PostgreSQL, MySQL etc. How do I find our the Postgres instance is running within an AWS Aurora cluster or not, from CLI? When I say from CLI this means terminal not AWS CLI.

Thanks.

  • select version() ; should tell you a few things about the instance. – ypercubeᵀᴹ Mar 14 '18 at 18:15
0

I'd recommend checking for the existence of the rdsadmin database (to be precise, this database exists for any RDS instance, not just an Aurora-based one). One way to check would be to use the psql command-line tool to output a list of databases. Just replace [AuroraClusterEndpoint] and [UserName] in the following

psql -h [AuroraClusterEndpoint] -U [UserName] --password -l

Sample output from psql - listing all databases

Of course, this assumes you haven't created a database named rdsadmin on your non-RDS Postgres cluster.

You could also use the SHOW ALL command within psql to check for the existence of an RDS-based run-time parameter:

enter image description here

With both solutions, just use whatever scripting tool you're comfortable with (Powershell, Bash, etc...) if you want to programmatically parse out the results

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.