Networking on AWS

Overview

Runbook for AWS Network Firewall designs, especially centralized inspection with Transit Gateway and VPC route tables. See also VPC Lattice for service-to-service connectivity.

Quick checklist

  • Confirm firewall endpoints exist in every inspected AZ.
  • Check route tables: traffic must route through the correct firewall endpoint or TGW attachment.
  • Enable flow and alert logs before incident testing.
  • Validate stateless default actions and stateful rule-group order.

References

Transit Gateway and Network Firewall

Original references (from Notion)

Original links preserved from your Notion page. All diagrams below use public AWS-hosted URLs (AWS blogs + AWS documentation) so they render without authentication.

Centralized traffic filtering

Deploy centralized traffic filtering using AWS Network Firewall | Amazon Web Services

Figure 2 — Network Firewall deployment automation architecture (AWS blog)


Deployment models

Deployment models for AWS Network Firewall | Amazon Web Services

Inspection VPC overview — deployment models (AWS blog)

North-south central egress model (AWS blog)

East-west inspection model (AWS blog)


Transit Gateway getting started

Tutorials: Get started with AWS Transit Gateway - Amazon VPC

Figure 3 — Example architecture before solution deployment (AWS blog)

Figure 4 — Example architecture after solution deployment (AWS blog)


Egress VPC with TGW + CDK

Building an egress VPC with AWS Transit Gateway and the AWS CDK | Amazon Web Services

Transit Gateway egress VPC architecture (AWS blog)


Outbound inspection (NAT + IGW)

Outbound traffic inspection through a NAT gateway and internet gateway - AWS Prescriptive Guidance

Outbound traffic inspection via NAT gateway (AWS Prescriptive Guidance)


Additional diagrams

Multi-AZ Network Firewall deployment (AWS blog)

Inspection VPC traffic flow (AWS blog)


Security groups

Control traffic to your AWS resources using security groups - Amazon Virtual Private Cloud

Protected VPC with Network Firewall endpoints (AWS blog)


Transit Gateway routing (from Notion)

How AWS Transit Gateway works - Amazon VPC

Transit gateway route tables in AWS Transit Gateway - Amazon VPC


Operational checklist (from Network Firewall parent)

From Network Firewall parent page:

  • Verify route tables: subnet → TGW attachment routes
  • Verify Network Firewall endpoints are in the correct AZ/subnets
  • Verify security groups + NACLs for inspection subnets
  • Log destinations: CloudWatch Logs / S3 (enable before incidents)
  • Stateless vs stateful rule groups: order + default action
  • Test reachability with Reachability Analyzer when possible

Architecture mental model

flowchart TB
    subgraph Spokes["Spoke VPCs (workloads)"]
        S1[Spoke VPC A]
        S2[Spoke VPC B]
    end

    subgraph Hub["Hub / Inspection VPC"]
        TGW_ATT[TGW VPC Attachment]
        NFW[AWS Network Firewall endpoints]
        NAT[NAT Gateway]
        IGW[Internet Gateway]
    end

    TGW[AWS Transit Gateway]

    S1 --> TGW
    S2 --> TGW
    TGW --> TGW_ATT
    TGW_ATT --> NFW
    NFW --> NAT
    NAT --> IGW
    IGW --> Internet((Internet))

    S1 -. east-west .-> S2
LayerControls
VPC route tableSends traffic toward TGW (spokes) or toward firewall subnets (hub)
TGW route tableDecides which attachment receives traffic (segmentation, egress steering)
Network Firewall policyAllow/deny at L3–L7 (stateless + stateful rule groups)
Security groups / NACLsEndpoint ENI reachability; stateless NACLs can break return traffic

Golden rules

  1. Symmetric routing — return path must mirror forward path (especially through firewall + NAT).
  2. One inspection path per flow — avoid hairpinning or double-NAT unless designed.
  3. AZ affinity — firewall endpoints and NAT in the same AZ as the traffic source when possible.
  4. TGW route table = segmentation — separate RTs to block spoke-to-spoke while allowing shared egress.

Deployment patterns

Pattern 1 — Centralized inspection VPC (hub)

All internet-bound and (optionally) east-west traffic is steered to a dedicated inspection VPC with Network Firewall endpoints, then to NAT/IGW.

Use whenProsCons
Multi-account / multi-VPC hub-and-spokeSingle policy enforcement point, easier auditingInspection VPC is a blast-radius / capacity choke point
Regulated egressConsistent logging and filteringCross-AZ charges if not designed carefully

Reference: Deploy centralized traffic filtering using AWS Network Firewall

Centralized inspection VPC (AWS blog)


Pattern 2 — Distributed (per-VPC) firewall

Network Firewall deployed in each VPC; TGW used only for connectivity.

Use whenProsCons
Strong isolation between tenantsNo shared inspection choke pointPolicy drift across VPCs
Lower cross-VPC traffic through hubSimpler per-VPC routingHigher operational overhead

Reference: Deployment models for AWS Network Firewall


Pattern 3 — Egress VPC (TGW + NAT, firewall inline)

Spokes send 0.0.0.0/0 (and RFC1918 if needed) to TGW → hub inspection VPC → NAT → IGW.

ComponentRole
Spoke RT0.0.0.0/0 → TGW
TGW RT (spoke)Default or hub CIDR → inspection VPC attachment
Inspection VPC RTFirewall subnet → NAT → IGW
Hub TGW RTRoutes back to spoke CIDRs

Reference: Building an egress VPC with AWS Transit Gateway and the AWS CDK

Egress VPC pattern with Transit Gateway (AWS blog)


Pattern 4 — East-west inspection between spokes

Spoke A → TGW → inspection VPC (Network Firewall) → TGW → Spoke B.

Requires explicit TGW routes (no silent propagation) and SG rules allowing peer CIDRs after firewall policy permits.


TGW routing deep dive

How TGW decides where to send packets

  1. Packet arrives at a TGW attachment (VPC, VPN, Direct Connect, peering).
  2. TGW uses the route table associated with that attachment (association).
  3. Longest-prefix match selects the target attachment.
  4. Optional route propagation auto-adds routes (often disabled in production for control).

Docs

East-west cross-region inspection with TGW (AWS blog)

Segmentation example (spokes isolated, shared egress)

Route tableAssociated withRoutes
tgw-rt-spoke-aSpoke A attachment10.0.0.0/16 → hub0.0.0.0/0 → hubno route to Spoke B
tgw-rt-spoke-bSpoke B attachment10.0.0.0/16 → hub0.0.0.0/0 → hubno route to Spoke A
tgw-rt-hubHub / inspection attachment10.1.0.0/16 → A10.2.0.0/16 → B

Mental model: TGW route table = who can talk to whom; VPC route table = how to reach TGW.


Network Firewall essentials

Components

ComponentPurpose
Firewall policyOrdered rule groups + default actions
Stateful rule groupConnection-aware allow/deny (Suricata-compatible)
Stateless rule group5-tuple matching; runs first
FirewallBinds policy to VPC
Firewall endpointsAZ-local ENIs in dedicated subnets

Docs

Network Firewall multi-AZ endpoint deployment (AWS blog)

Routing in the inspection VPC (typical)

Spoke → TGW → Inspection VPC subnet
              → Route: 0.0.0.0/0 or peer CIDR → Firewall endpoint
              → Firewall endpoint subnet RT → NAT (egress) or back to TGW (east-west)

Rule evaluation order (simplified)

  1. Stateless rules (custom + AWS managed)
  2. Stateful rules
  3. Default action in policy (drop or forward)

Enable alert and flow logs to S3 or CloudWatch before go-live.


From your Hub-and-spoke network notes — applies directly when adding a firewall:

Part 1 — All VPCs communicate; internet only via hub

GoalRoute pattern
Spoke ↔ SpokeSpoke RT: peer CIDR → TGW; TGW RT: both spokes in same or hub RT
Spoke → InternetSpoke RT: 0.0.0.0/0 → TGW; Hub: NAT + IGW
Hub → InternetPrivate RT: 0.0.0.0/0 → NAT; Public RT: 0.0.0.0/0 → IGW

With firewall: insert Network Firewall between TGW attachment subnets and NAT for egress; update RTs so traffic hits firewall endpoints first.

Part 2 — Spokes isolated (no b ↔ c), shared egress

  • Separate TGW route tables per spoke (tgw-rt-btgw-rt-c)
  • Hub RT has routes to both; spoke RTs have no cross-spoke routes
  • Disable automatic propagation if it re-opens east-west paths

Troubleshooting playbook

Symptom: No connectivity spoke → internet

#Check
1Spoke VPC RT: 0.0.0.0/0 → TGW
2TGW RT: route to inspection/hub attachment
3Inspection VPC RT: traffic routed to firewall endpoint subnets
4Firewall policy: default action not dropping unexpectedly
5Post-firewall RT: 0.0.0.0/0 → NAT
6NAT in public subnet, EIP attached
7Public RT: 0.0.0.0/0 → IGW
8SG on firewall endpoint ENIs: allow required ports
9NACLs: not blocking ephemeral return ports

Symptom: Spoke ↔ spoke works when it should not

#Check
1Separate TGW route tables — no route between spoke CIDRs
2Route propagation disabled or scoped
3Correct association: each attachment → intended RT only

Symptom: Intermittent / one-AZ failures

#Check
1Firewall endpoint per AZ used by workloads
2NAT Gateway AZ matches active traffic path
3TGW attachment subnets span required AZs

Tools


AWS Transit Gateway

TopicLink
What is a transit gateway?https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html
TGW attachmentshttps://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html
Appliance modehttps://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-appliance-scenario.html
Inter-Region peeringhttps://docs.aws.amazon.com/vpc/latest/tgw/tgw-peering.html
Quotashttps://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-quotas.html

AWS Network Firewall

TopicLink
Developer Guidehttps://docs.aws.amazon.com/network-firewall/latest/developerguide/what-is-aws-network-firewall.html
Creating a firewallhttps://docs.aws.amazon.com/network-firewall/latest/developerguide/firewall-creating.html
Suricata-compatible ruleshttps://docs.aws.amazon.com/network-firewall/latest/developerguide/stateful-rule-groups-ips.html
AWS managed rule groupshttps://docs.aws.amazon.com/network-firewall/latest/developerguide/aws-managed-rule-groups.html
Monitoringhttps://docs.aws.amazon.com/network-firewall/latest/developerguide/monitoring-cloudwatch.html

Prescriptive & architecture guidance

TopicLink
Inline traffic inspection (third-party appliances)https://docs.aws.amazon.com/prescriptive-guidance/latest/inline-traffic-inspection-third-party-appliances/welcome.html
Centralized egress with TGWhttps://docs.aws.amazon.com/whitepapers/latest/building-scalable-secure-multi-vpc-network-infrastructure/centralized-access-to-the-internet.html
AWS Security Reference Architecturehttps://docs.aws.amazon.com/prescriptive-guidance/latest/security-reference-architecture/welcome.html
Well-Architected — Security pillarhttps://docs.aws.amazon.com/wellarchitected/latest/security-pillar/welcome.html

Blogs (same series as Notion)

TitleLink
Centralized traffic filteringhttps://aws.amazon.com/blogs/networking-and-content-delivery/deploy-centralized-traffic-filtering-using-aws-network-firewall/
Deployment modelshttps://aws.amazon.com/blogs/networking-and-content-delivery/deployment-models-for-aws-network-firewall/
Egress VPC with TGW + CDKhttps://aws.amazon.com/blogs/networking-and-content-delivery/building-an-egress-vpc-with-aws-transit-gateway-and-the-aws-cdk/
Automating Network Firewall with CDKhttps://aws.amazon.com/blogs/networking-and-content-delivery/automating-aws-network-firewall-deployments-with-aws-cdk/
East-west inspection with TGWhttps://aws.amazon.com/blogs/networking-and-content-delivery/centralized-inspection-of-east-west-traffic-using-aws-transit-gateway/

Public architecture diagrams (AWS blogs & documentation)

AWS WAF for Application Load Balancers

Note: AWS WAF protects HTTP/S at ALB/API Gateway/CloudFront. Network Firewall operates at VPC perimeter (L3–L7). Use both in layered defense.


Quick comparison: Network Firewall vs WAF vs SG

ControlLayerScope
Security GroupInstance ENIAllow/deny per ENI
Network ACLSubnetStateless subnet boundary
Network FirewallVPC / TGW hubCentralized IDS/IPS-style filtering
AWS WAFALB / CloudFront / API GWHTTP/S application attacks

VPC Lattice

Notes for Amazon VPC Lattice service-to-service connectivity, authorization, and observability across VPCs and accounts.

Key concepts

  • A service network is the logical boundary for services and resource configurations.
  • Clients reach the network through VPC association or a service-network VPC endpoint.
  • Use auth policies and observability deliberately; connectivity is not authorization.

When to consider

  • Microservices that span VPCs/accounts and need simpler application networking.
  • Modernization paths where service discovery, connectivity, and monitoring should be centralized.

References