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.
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.
Relevant questions
RDS Database Instance does not show up in dropdown when creating RDS Proxy
asked 4 months agoConnect Lightsail instance to AWS instance in a private subnet
asked 2 months agoCan't connect to RDS database from remote
asked 5 months agoHow do I configure an Amazon MQ instance that's in a VPC to invoke a Lambda function?
Accepted Answerasked a year agoIssues connecting to Postgres RDS instance from within a VPC
asked 3 years agoHow can I connect Google Data Studio to an Private AWS RDS Postgres instance?
asked 23 days agoCan't connect to an RDS Instance from Lambda (different account tough)
asked 2 years agoUnable to enter create read replica page for a MySQL RDS instance inside classic EC2
Accepted Answerasked 5 months agoHow to create SSL dblink connection from RDS to postgres on premise?
asked 5 months agoUse RDS Postgres Replicas as a cluster
Accepted Answerasked 5 months ago