The symptom: everything works, just over the wrong path
Ruling out the usual suspects
Longest prefix match decides, not the attachment
Reading the route tables on both sides
BASH
aws ec2 describe-route-tables \
--filters 'Name=vpc-id,Values=vpc-0123456789abcdef0' \
--query 'RouteTables[].{Table:RouteTableId,Subnets:Associations[].SubnetId,Routes:Routes[].[DestinationCidrBlock,VpcPeeringConnectionId,TransitGatewayId,State]}' \
--output jsonTEXT
Illustrative output format (trimmed):
Table: rtb-0aaa... Subnets: subnet-0app1..., subnet-0app2...
10.1.0.0/16 local active
10.2.0.0/16 pcx-0bbb... active <- more specific, wins
10.0.0.0/8 tgw-0ccc... active <- only used when nothing longer matchesCutting over in a safe order
- Confirm the Transit Gateway path is ready on its own. Both VPC attachments should be associated with the intended TGW route table, that table should have routes for both VPC CIDRs, and each attachment should have a subnet in every Availability Zone where the workload runs.
- Check anything tied to peering beyond routes. Security group rules that reference a security group in the peer VPC are a common example. Depending on your setup, those may not work over a Transit Gateway and might need to become CIDR-based rules first.
- In the first VPC, change the target of the specific route from the peering to the Transit Gateway, one route table at a time. Replacing the target keeps the same prefix, so there is no moment where traffic falls through to a different route.
- Do the same for the return routes in the other VPC, soon after step 3, to keep the period of asymmetric routing short.
- Watch the Transit Gateway attachment metrics rise and peering traffic drop to zero. Leave the peering in place for a while as a fallback.
- Only then delete the peering connection.
BASH
# Changes live routing: replaces the target of an existing route, same prefix
aws ec2 replace-route \
--route-table-id rtb-0123456789abcdef0 \
--destination-cidr-block 10.2.0.0/16 \
--transit-gateway-id tgw-0123456789abcdef0--vpc-peering-connection-id and the old peering ID, as long as the peering still exists. That is why it should outlive the route changes. Once the peering is deleted, any route still pointing at it becomes a blackhole, and a newly created peering gets a new ID that every route would need to use.
An alternative is to delete the specific peering routes and let the broad /8 TGW route take over. It works, but now reachability depends on a summary route that someone may later narrow or remove. Replacing the target keeps the intent explicit: this CIDR goes to the hub. If you want broad coverage as well, keep the summary route as a backstop, not as the main path.
From a support point of view, this is the question to ask first when someone says the TGW is live but the peering is still busy: what does the subnet route table actually say for the destination CIDR, and on both sides? It is a faster answer than reviewing the hub configuration again. If the VPCs are attached but still cannot reach each other at all, that is a different issue, covered in why two VPCs peered to the same hub still cannot reach each other.
The practical rule is short. A Transit Gateway only receives traffic that the VPC route table sends to it, and the route table always prefers the longest matching prefix. Before you remove any peering, list every route table in both VPCs, move each specific peering route to the Transit Gateway with the same prefix, confirm traffic has shifted using metrics or flow logs, and delete the peering last.