VPC peering: Accessing a resource in public subnet from a public subnet through peering connection issues

rdsvpc-peering

I have set vpc peering between these VPCs (vpc-1 and vpc-2).
I have my RDS in vpc-1 in this subnets (10.13.1.0, 10.13.2.0, 10.13.3.0) with this route rtb-vpc1-rds.
In the second VPC and two subnets : one public (10.12.1.0 with route rtb-vpc2RoutePub) and other private (subnet 10.12.2.0 and route rtb-vpc2RoutePriv) with a nat.
I created the right routes using the peering connections, and i created the right security groups.

From the private subnet (10.12.2.0) i can access my RDS instances but from the public i can't.

telnet myrds.cnojzxstksnn.eu-west-1.rds.amazonaws.com 5432
Connected to myrds.cnojzxstksnn.eu-west-1.rds.amazonaws.com.
Escape character is '^]'.

when i try from my public subnet (10.12.1.0)

telnet myrds.cnojzxstksnn.eu-west-1.rds.amazonaws.com 5432 !5889
Trying 10.13.3.234...

Do you have any idea about what i did wrong?

Thanks for your help and comments.
Regards,

Best Answer

VPC peering does not care about public vs. private subnets.

Take another look at your security group rules and route tables. You have something misconfigured, and that is what is causing your problems. Remember that both systems involved in the communication need to have routes to each other through your pcx endpoint.

Related Topic