Home > Enterprise >  Cannot connect to Amazon RDS database
Cannot connect to Amazon RDS database

Time:02-25

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?

CodePudding user response:

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.)

CodePudding user response:

There is not enough information in your question to be certain, but here are two suggestions:

1 - verify that the subnets for the database actually are public and that there is a route to the IGW

2 - add a rule to the inbound security group rules to allow you to connect to port 5431. Generally you'd want to restrict this to just your IP address for a public instance.

Also, I'm not sure why you have 192.31.0.0 as part of your VPC range - that is a public IP range.

  • Related