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.
1 Answer 1
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:
With both solutions, just use whatever scripting tool you're comfortable with (Powershell, Bash, etc...) if you want to programmatically parse out the results
select version() ;
should tell you a few things about the instance.