This Terraform module builds AWS VPCs with subnets, gateways, routing, and optional security and logging controls.
Overview
The AWS VPC Terraform module declares Virtual Private Cloud resources on AWS through Terraform. Registry documentation describes creating a VPC with public and private subnets, availability zones, NAT gateways, VPN gateways, tagging, and related networking objects.
NAT gateway layouts can follow per-subnet defaults, a single shared gateway, or one gateway per availability zone. Optional behaviors include reusing existing Elastic IPs for NAT, dedicated network ACLs per subnet type, intra subnets without internet routes, flow logs, transit gateway integration, and CIDR planning with AWS IPAM previews.
The module exposes many inputs for database, ElastiCache, Redshift, and Lambda-oriented subnet patterns, public access toggles, IPv6 and dual-stack examples, and conditional creation toggles for selective deployments.
Teams embed the module in Terraform projects and run plan and apply against an AWS account. It automates VPC design rather than operating as standalone network software.
Key features
- VPC and subnet creation
- NAT gateway layout options
- Internet and VPN gateways
- Route tables and associations
- Network ACL management
- Flow log integration
- Transit gateway attachment patterns
- IPAM-based CIDR workflows
Use cases
- Baseline AWS VPC topologies
- Multi-AZ private and public subnets
- Stable NAT Elastic IP reuse
- Lambda-only private subnets
- Dual-stack or IPv6 VPC designs