Thank you very much!! this is really helpful. Do we need to pass 'sslrootcert" as mentioned in the doc below? I see that you have not used it in your command.
We have AWS RDS and we are trying to connect to DB remotely from EC2 instance.as client connection using psql. We are trying to set up IAM roles. We did all the necessary settings but got below error. Could you please advise?
Password for user lmp_cloud_dev:
psql: FATAL: PAM authentication failed for user "testuser"
FATAL: pg_hba.conf rejects connection for host "192.168.1.xxx", user "testuser", database "testdb", SSL off
Regards,
Aditya.
Hi Aditya,
See the below example of me connecting to RDS from an EC2 instance:
You need to change the $RDSHOST value
you need to replace my “app_user” to your “testuser” and database “postgres” to your “testdb”