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.

mustaccio
28.6k24 gold badges60 silver badges77 bronze badges
asked Mar 12, 2018 at 6:55
1
  • select version() ; should tell you a few things about the instance. Commented Mar 14, 2018 at 18:15

1 Answer 1

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:

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

answered Mar 14, 2018 at 16:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.