VPC Peering connects two VPCs so they can talk to each other privately using private IPs, as if they are inside the same network.
Think of it as removing a wall between two private offices so people inside both offices can walk between them.
Because sometimes:
But you don’t want them exposed to the internet.
So you peer both VPCs → they can communicate securely using private IPs.
Let’s say you have two VPCs:
CIDR: 10.0.0.0/16
Public Subnet: 10.0.1.0/24
Private Subnet: 10.0.2.0/24
CIDR: 10.1.0.0/16
Private Subnet: 10.1.1.0/24
Your web application runs in VPC A,
your database runs in VPC B.
To allow your app → DB connection: