0
0
AWScloud~10 mins

VPC peering concept in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - VPC peering concept
Create VPC A
Request Peering
Accept Peering
Peering Active
Update Route Tables
Traffic Allowed Between VPCs
Two VPCs are created separately. One requests peering, the other accepts. Once active, route tables are updated to allow traffic between them.
Execution Sample
AWS
1. Create VPC A and VPC B
2. VPC A sends peering request to VPC B
3. VPC B accepts peering request
4. Update route tables in both VPCs
5. Traffic flows between VPC A and VPC B
This sequence shows how two VPCs connect via peering to enable communication.
Process Table
StepActionState ChangeResult
1Create VPC AVPC A existsVPC A ready
2Create VPC BVPC B existsVPC B ready
3VPC A sends peering requestPeering request pendingWaiting for acceptance
4VPC B accepts peeringPeering connection activePeering established
5Update route tablesRoutes added to VPC A and BTraffic allowed between VPCs
6Test traffic flowPackets sent between VPCsCommunication successful
💡 Peering active and routes updated, so traffic flows between VPCs
Status Tracker
VariableStartAfter Step 3After Step 4After Step 5Final
VPC ANot createdExistsExistsExistsExists
VPC BNot createdExistsExistsExistsExists
Peering ConnectionNonePendingActiveActiveActive
Route TablesNo peering routesNo peering routesNo peering routesRoutes addedRoutes added
Traffic FlowBlockedBlockedBlockedAllowedAllowed
Key Moments - 3 Insights
Why can't VPCs communicate immediately after peering request is sent?
Because the peering connection is only pending (see step 3 in execution_table). It must be accepted (step 4) and routes updated (step 5) before traffic flows.
What happens if route tables are not updated after peering is active?
Traffic will still be blocked because route tables control network paths (see step 5 and 6). Updating routes is essential for communication.
Can VPC peering connect VPCs in different AWS accounts?
Yes, but the peering request and acceptance must be done across accounts. The flow remains the same as shown in the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does the peering connection become active?
AStep 4
BStep 5
CStep 3
DStep 6
💡 Hint
Check the 'State Change' column for when peering connection status changes to active.
According to variable_tracker, what is the state of 'Traffic Flow' after step 4?
AAllowed
BBlocked
CPending
DUnknown
💡 Hint
Look at the 'Traffic Flow' row under 'After Step 4' column.
If route tables are not updated, what will be the result in step 6?
ATraffic allowed between VPCs
BPeering connection fails
CTraffic blocked despite active peering
DVPCs get deleted
💡 Hint
Refer to key_moments about route tables and execution_table step 5 and 6.
Concept Snapshot
VPC Peering connects two VPCs to enable private communication.
One VPC requests peering; the other accepts.
Peering becomes active after acceptance.
Route tables must be updated to allow traffic.
Traffic flows only after routes are set.
Peering works within or across AWS accounts.
Full Transcript
VPC peering allows two separate virtual networks (VPCs) to connect privately. First, both VPCs are created. Then, one VPC sends a peering request to the other. The second VPC must accept this request. Once accepted, the peering connection becomes active. However, to enable communication, route tables in both VPCs need to be updated to include routes pointing to the other VPC. Only after these updates can traffic flow between the VPCs. If route tables are not updated, even an active peering connection will not allow traffic. This process works for VPCs in the same or different AWS accounts.