Skip to content

Communication between the public subnet and the private subnet of different VPCs

0

We have 2 VPCs, VPC A and VPC B. Each VPC has a private subnet and a public subnet connected via NAT. There's a peering connection between the private subnets of VPC A and VPC B. Most of our ECS services are inside the private subnet but some are in the public subnet. Now a service X in the public subnet of VPC A is able to communicate with the service Y in the private subnet of VPC A. We also have a service Z inside the private subnet of VPC B, which currently is unable to communicate with service X. How to make service X to communicate with service Z without using Transit Gateway or Private Link?

Thanks, PH

1 Answer
2
Accepted Answer

You have VPC Peering. All Subnets in both VPCs can talk to each other using their Private IP Addresses. Theres nothing that needs doing apart from ensuring theres no ACLs that block traffic, and the security groups allow traffic.

Other thing to check is if your using the AWS DNS Names, enable inbound DNS resolution on the VPC Peering connections otherwise they may resolve to Public IPs.

EXPERT
answered a year ago
  • I would add to this answer that you also need to make sure you added the correct routing entries for each VPC.

    Having peering is enough to allow services in VPC A and VPC B to talk to each other as Gary said.

  • Thanks Gary & Mariano. It worked after I added a route through the peering connection and also allowed the traffic in the security group.

  • Agree MarianoRD.. I assumed the routing had been setup. Thanks for the Update Blacktulip

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.