Bringing up Amazon RDS PostgreSQL Instance using Terraform. Can't login to it after creation (no pg_hba.conf entry error)

Hi all,

I am trying to bring up a Amazon RDS Instance (PostgreSQL) using Terraform. I see all the necessary entities like VPC, subnets, security group, db param group and the PostgreSQL RDS Instance getting created. However, when I try to login to the DB from my PC using the command “psql -h -p 5432 -U ”, it prompts me for the password. And after I enter the right password, it throws the following error.

What I created is a non multi-AZ RDS instance.

psql: error: connection to server at “” (52.34.83.100), port 5432 failed: FATAL: password authentication failed for user “postgres”
connection to server at “” (52.34.83.100), port 5432 failed: FATAL: no pg_hba.conf entry for host “75.238.220.178”, user “postgres”, database “postgres”, no encryption.

Have any of you seen this error? If so, do you know what parameter in terraform resource aws_db_instance or parameter group helps address the issue?

One additional information. I am able to login to a similar RDS PostgreSQL instance from AWS console (i.e. non multi-AZ RDS instance and with mostly default configuration), I am able to login to it from PC just fine. It looks like the param group created for this DB instance is hidden so couldn’t cross check the params I used in my terraform code with this param group.

Thanks for any insights in advance.

Tej