Amazon's Aurora PostgreSQL
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



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