Search code examples
amazon-web-servicesamazon-ec2amazon-rdsamazon-vpc

Cannot connect to Amazon RDS database


I've been trying to create and connect to a new DB on AWS for days. I made it publicly accessible.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

I've done this but it can't connect:

enter image description here

HOST: vepo-qa-database.xxxxxxx.ap-southeast-2.rds.amazonaws.com

URL: jdbc:postgresql://vepo-qa-database.xxxxxxx.ap-southeast-2.rds.amazonaws.com:5432/

enter image description here

enter image description here

Why will it not connect?

enter image description here


Solution

  • Your Security Group inbound rule configuration is:

    • Allow Inbound traffic on any port as long as it comes from sg-1fefe550 (itself!)

    Security Group

    This means that only resources associated with that same security group can communicate with the database. Therefore, it is blocking access from your own computer on the Internet.

    To enable access to the database, you should add another Inbound rule that permits inbound access on port 5432 (PostgreSQL) from your own IP address.

    (I'm also not sure why you have configured the security group to permit access from 'itself'. This is not a normal way to configure security groups.)