Two VPCs peered, but the app in VPC A cannot reach VPC B's database. What is the routine?
IntermediateScenarioVPC and Networking
Answer
Situation read → Peering needs routes on both sides plus SG and DNS settings.
What I'd do →
- Check peering is
active:aws ec2 describe-vpc-peering-connections - Add routes in both VPC route tables to the peer CIDR
- Check the DB SG allows the source CIDR or the peer SG reference (cross-account SG references work only in the same region)
- Check NACLs
- Enable DNS resolution over peering if using private hostnames
Why → Peering creates a path only; routing and filtering are still your job.
Interview tip → Peering never routes through a third VPC.
More on VPC and Networking
What is a VPC and what are the CIDR constraints?BeginnerWhat makes a subnet public or private?BeginnerHow do route tables work, including the local route and longest-prefix match?IntermediateInternet Gateway vs NAT Gateway: what does each do?BeginnerNAT Gateway vs NAT instance?IntermediateSecurity group vs network ACL: compare them.Beginner