Skip to content

Repository files navigation

AWS Network Firewall Terraform Templates

Sample Terraform templates demonstrating AWS Network Firewall routing architectures and deployment models.

Looking for CloudFormation? These same architectures are available as CloudFormation templates: aws-networkfirewall-cfn-templates

Available Architectures

Centralized Architecture

Uses AWS Transit Gateway for centralized inspection of East-West (VPC-to-VPC) and egress (internet-bound) traffic.

Attaches AWS Network Firewall directly to Transit Gateway as a native attachment. AWS creates and manages the inspection VPC transparently, removing the need to create and manage your own.

Note: Transit Gateway-Attached Firewall is required to use Transit Gateway Flexible Cost Allocation for chargebacks. The other centralized deployment models in this repository do not support this feature.

Template Use Case
Manual Deployment Learning and hands-on configuration
Pre-Deployed Automated provisioning

TGW-Attached Firewall

Routes traffic through a dedicated inspection VPC containing the firewall endpoints.

Template Use Case
Single AZ Single availability zone
Two AZ High availability across two AZs

Centralized Architecture

Distributed Architecture

Deploys AWS Network Firewall into each VPC individually. No Transit Gateway required—each VPC is protected independently.

Leverages the VPC Endpoint Association feature to deploy multiple firewall endpoints per availability zone to maintain source IP visibility when inspecting both ingress and egress traffic with the same firewall.

Multi-Endpoint Architecture

Single firewall endpoint per availability zone with options for combined or separate ingress/egress inspection.

Configuration Single AZ Two AZ
Combined Ingress/Egress Firewall Template Template
Separate Ingress/Egress Firewalls Template Template

Distributed Architecture - Combined

Distributed Architecture - Separate

Workshop-based templates for deploying egress inspection using AWS Cloud WAN and AWS Network Firewall across multiple regions.

Cloud WAN Architecture

Terraform templates for creating a comprehensive monitoring dashboard for AWS Network Firewall metrics and logs.

License

This sample code is made available under the MIT-0 license. See the LICENSE file.

Additional Resources

About

This repository contains terraform code to deploy the necessary resources to get started to test AWS Network Firewall.

Resources

Code of conduct

Contributing

Security policy

Stars

81 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages