Issues connecting to Postgres RDS instance from within a VPC


I have a RDS postgres instance in a VPC. The RDS instance is publicly accessible.
In the same VPC, I have an ubuntu instance. Both are using the same security group.

The security group allows ingress and egress TCP/UDP traffic on all ports for subnets within the VPC, and from my home IP address. The security group is also used for the VPC.

I setup the RDS db subnet group to use all subnets within the VPC.

I am unable to connect to postgres from the ubuntu instance. The connection times out.
But, I am able to connect from my home IP.

To debug, I added a rule to the VPC security group to allow ingress/egress TCP traffic on port 5432 (postgres) from the PUBLIC ip address of the ubuntu instance. Now, I can connect to the postgres instance from the ubuntu instance.

Is this what is expected? I that must go out and back in the i-gateway to get to the RDS instance?

What I am missing that should route the traffic directly between my ubuntu instance to the RDS instance?

Thanks for any help.

asked 4 years ago199 views
1 Answer

Found my issue. I had launched the VPC to host a domain controller and several windows servers that I imported from my local environment. My imported domain controller was responsible for resolving the host names within the VPC. My domain controller was not configured to work with AWS or RDS, so it was unaware of the local address for the RDS instance. I did not try to figure out how to make my domain controller work with AWS and RDS.

When I took a second look at what I was trying to achieve, it was better to move the Linux and RDS instances into a separate VPC. In this 2nd VPC, I allowed AWS to manage the DHCP and DNS as usual. In side this 2nd VPC things work just as I expected. I was able to access the RDS instance using a local route.

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions