Sub topic 17
Troubleshooting with Reachability Analyzer and understanding costs
This chapter assumes you have built a transit gateway hub and a PrivateLink endpoint, as in the earlier chapters. You should be comfortable with route tables, security groups, network ACLs, and the AWS CLI.
A triage order
Most connectivity failures come from a small set of causes. Check them in the order traffic travels.
Missing return routes are the most common miss. Connectivity needs routes in both directions.
Reachability Analyzer
Reachability Analyzer reads your configuration and reports whether a path exists between two resources. It does not send packets. If no path exists, it names the component that blocks it, such as a route table, security group, or network ACL.
PATH_ID=$(aws ec2 create-network-insights-path \
--source i-0aaa1111bbb22222c \
--destination i-0ddd3333eee44444f \
--protocol tcp \
--destination-port 443 \
--query 'NetworkInsightsPath.NetworkInsightsPathId' \
--output text)
ANALYSIS_ID=$(aws ec2 start-network-insights-analysis \
--network-insights-path-id "$PATH_ID" \
--query 'NetworkInsightsAnalysis.NetworkInsightsAnalysisId' \
--output text)
aws ec2 describe-network-insights-analyses \
--network-insights-analysis-ids "$ANALYSIS_ID" \
--query 'NetworkInsightsAnalyses[0].[Status,NetworkPathFound,Explanations]'Wait until Status is succeeded. If NetworkPathFound is false, the Explanations list identifies the blocking component, for example a route table with no route to the destination.
VPC Flow Logs
Use flow logs when the configuration looks correct but traffic still fails. A flow log record shows whether traffic was accepted or rejected.
REJECTon the destination side usually means a security group or network ACL blocked the traffic.- Traffic that appears at the source but never reaches the destination points to a routing problem.
- Network ACLs are stateless. A
REJECTon return traffic often means the ephemeral port range is not allowed. - Flow logs can also be enabled on transit gateway attachments, which helps when the problem is between VPCs.
Understanding costs
Prices vary by Region and change over time, so check the AWS pricing pages. The charge structure matters more than the numbers.
| Option | Hourly charge | Data charge |
|---|---|---|
| VPC peering | None | Data transfer, including cross-AZ and cross-Region traffic |
| Transit gateway | Per attachment | Per GB processed |
| PrivateLink | Per endpoint, per AZ | Per GB processed |
PrivateLink also adds the provider's Network Load Balancer cost. Placing an interface endpoint in every AZ multiplies the hourly charge. Create endpoints only in the AZs that need them. Traffic that crosses a transit gateway pays the per-GB fee on every pass. A centralized inspection design can therefore cost noticeably more than direct peering for high-volume traffic.
Exercise
A VPC route sends traffic for 10.1.0.0/16 to the transit gateway, and the TGW route table has a propagated route to that CIDR. Connections still time out. Reachability Analyzer reports a path from A to B. What should you check next?
Show answer
Check the return path. Confirm that VPC B has a route to VPC A's CIDR through the transit gateway, and that VPC A's attachment CIDR is propagated into the route table that B's attachment is associated with. Then check network ACL ephemeral ports and the security group on B, and read flow logs for REJECT records.