내용으로 건너뛰기

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개 답변
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.

전문가
답변함 일 년 전
  • 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

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.