跳至內容

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 年前檢視次數 387 次
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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。