RDS Postgres 15.2 password authentication failed

0

Hello Team, I created an RDS Postgres 15.2 instance with a predefined user. When I try to connect to this instance from the EKS pod with psql (version 14.9) I received: / # psql --host=zzz.rds.amazonaws.com --port=5432 --username=zzz --dbname=postgres Password for user zzz: psql: error: connection to server at "zzz.rds.amazonaws.com", port 5432 failed: FATAL: password authentication failed for user "zzz" connection to server at "zzz.rds.amazonaws.com" (10.128.29.18), port 5432 failed: FATAL: password authentication failed for user "zzz" When I tried to run the ansible playbook from another pod in the same namespace, it had a connection. Also, I can connect with psql to older RDS in the same region, VPC, and Security Group. The user, password, and DB are correct. Security Group allows access to pods. Are there any changes related to RDS access? Thank you

asked 6 months ago193 views
1 Answer
0

If you're using Engine 15 or higher:

When setting up a database in RDS, the default parameter group for PostgreSQL 15 (default.postgres15) is used. However, if you need to change the 'rds.force_ssl' parameter, which isn't editable in the default.postgres15 group, you'll need to create a new parameter group for PostgreSQL 15, allowing you to make edits.

Here's how you can do it:

  1. Create a New Parameter Group: Go to the RDS console, navigate to the Parameter groups section, and click on "Create parameter group." Select "PostgreSQL" as the family, choose version 15, and provide a name for your new parameter group.

  2. Modify the 'rds.force_ssl' Parameter: Select the newly created parameter group, locate the 'rds.force_ssl' parameter, and change its value from 1 to 0.

  3. Apply the Parameter Group to Your Database: Go to the database configuration tab, select the "DB instance parameter group" option, and switch from the default group to the new one you created.

  4. Reboot the Database: After applying the new parameter group, reboot the database instance to apply the changes.

After making these changes, you should be able to connect to your PostgreSQL database instance without requiring SSL.

Or you can also try using this connection string for the password authentication. Here's how you can modify the psql command to include the password in the connection string:

psql -h <hostname> -U <username> -d <dbname> -W
AWS
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions