0

I just created a simple postgres database.

It gave me a link that I could use to connect to it, so I tried connecting using pgadmin but it gives a timed out error.

So, I read the documentation again and I've made sure that my VPC security group is correct. It has an inbound rule - postgres port 5432 on a security group sg-something-something.

enter image description here

However, that still wasn't working. Now, I've added one more inbound rule postgres port 5432 on myIP and that lets me log into the database.

enter image description here

Is this really the right approach?

3
  • How would you expect it to know it was you -- coming from outside AWS -- unless you explicitly allow access from your IP address? Feb 27, 2017 at 2:03
  • I tried using psql client after SSH into the ec2 instance, but still got some issues. I don't really familiar with infrastructure stuff, so I'm struggling :( Feb 27, 2017 at 3:39
  • 1
    This is how AWS is designed. RTFM.
    – Tim
    Feb 27, 2017 at 8:01

2 Answers 2

2

That's sort of the right approach.. Ideally you would be running your RDS instances inside a private subnet so they aren't accessible from the public internet at all. Then, you would either configure a vpn connection with aws, or set up a bastion host that you could pass through for connectivity.

But strictly speaking with the instance you already have, adding your public Ip in the only way to get access from your machine.

0

I just went through this last week. You will need to add at least your server IP to work with your databases in the instance as @tayworm stated. If you are using your databases in websites you may need to set the IP Address (CIDR) to 0.0.0.0/0. At least I had to do this for my Heroku applications.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .