跳至内容

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 年前372 查看次数
1 回答
2
已接受的回答

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.

专家
已回答 1 年前
  • 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

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。