I need assistance as I'm having trouble connecting to a managed Postgres database on RDS. I'm encountering the following error message: "no pg_hba.conf entry for host '16.151.149.51', user 'analytics', database 'database', no encryption" I have confirmed that encryption is functioning properly, and I've also added the IP to the security groups. What steps should I take to resolve this issue?
First of all I wanna note that Nick's answer resolved my issue, but I just would love to add a detailed steps to follow for those who's new to AWS:
Create a New Parameter Group:
- Open the Amazon RDS console at https://console.aws.amazon.com/rds/.
- In the navigation pane, choose "Parameter groups".
- Click "Create parameter group" at the top right of the page.
- In the "Parameter group family" dropdown, select "postgres15".
- In the "Group name" field, enter a name for the new parameter group.
- In the "Description" field, enter a description for the new parameter group.
- Click "Create" at the bottom right of the page.
Modify the rds.force_ssl Parameter of your new Parameter Group:
- In the list of parameter groups, click on the name of the new parameter group you just created.
- In the "Filter parameters" box, type rds.force_ssl and press Enter.
- You should see the rds.force_ssl parameter. Click "Edit parameters".
- Change the value of rds.force_ssl from 1 to 0, then click "Save changes".
Associate Your RDS Instance with the New Parameter Group:
- In the navigation pane, choose "Databases".
- Click on the name of your RDS instance.
- Click "Modify" at the top right of the page.
- In the "Database options" section, find the "DB parameter group" setting and select the new parameter group you created from the dropdown menu.
- Scroll down and click "Continue".
- Review the summary of modifications and click "Modify DB Instance".
Reboote Your RDS Instance:
- In the navigation pane, choose "Databases".
- Click on the name of your RDS instance.
- Click "Actions" at the top right of the page, then "Reboot".
- Confirm that you want to reboot the instance.
By following these steps, you should be able to successfully modify the rds.force_ssl parameter in your Amazon RDS instance. And hopefully the connection issue would be resolved.
Note: this method removes the default SSL security in the connection and shouldn't be used in production databases.