I have setup Postgres RDS instance on AWS. Made it publicly accessible and security group allows all traffic inside and outside.

However I still can't connect from outside network (using DataGrip).

Connection to jdbc:postgresql://name.abcd.eu-west-1.rds.amazonaws.com :5432/mydb failed. Host name.abcd.eu-west-1.rds.amazonaws.com is unknown. [08001] The connection attempt failed.

I copied the endpoint from AWS console and I'm using the username and password I entered when creating the instance.

What am I doing wrong?

  • 1
    How long ago did this happen? THe DNS can take a while to propagate. What happens when you try "host name.abcd.eu-west-1.rds.amazonaws.com" from your PC (or nslookup/dig)? – TheFiddlerWins Nov 1 '17 at 17:36
  • 1
    "Host name is unknown" is likely the problem. Do an nslookup to start. If that works check your connect string format. – Tim Nov 1 '17 at 18:32

The problem was in DataGrip itself. It put a space between port and host

 ...amazonaws.com :5432...

To get it working you have to:

  • make instance publicly accessible when creating
  • setup inbound traffic properly for instance's security group

When this is done, just try this command psql -h endpoint -U username -d databasename in you command line so you know you can connect. If it succeeds, you should be able to connect via DataGrip and any other client too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.