Saltar al contenido

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

preguntada hace un año387 visualizaciones
1 Respuesta
2
Respuesta aceptada

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.

EXPERTO
respondido hace un año
  • 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

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.