The Minimal Production VPC: One Module Call

Strip a VPC to its essentials and it’s a surprisingly small amount of Terraform — the module does the rest: three subnet tiers, per-AZ route tables, NAT gateways, IGW, NACLs, flow logs, and Kubernetes-ready subnet tags.

The configuration

terraform {
  required_version = ">= 1.0.0"
}

provider "aws" {
  region = var.aws_region
}

module "vpc_app_example" {
  source = "../../modules/vpc-app"

  aws_region       = var.aws_region
  cidr_block       = "10.0.0.0/16"
  num_nat_gateways = 3
}

That’s the whole app VPC. Inputs: a CIDR and a NAT count. Everything else is the module’s baked-in defaults.

What you get for those 4 arguments

  • Three subnet tiers (public / private-app / private-persistence) spread across every AZ in the region
  • Per-AZ private route tables — each zone fails independently through its own NAT
  • Flow logs to CloudWatch from day one
  • The Kubernetes tag contract — kubernetes.io/role/elb and kubernetes.io/role/internal-elb so EKS load balancers land in the right tiers automatically

Why the minimal example matters

This is the paved path pattern in its purest form: the module carries the production decisions, the caller carries the environment decisions. A service team copying 15 lines gets a VPC an SRE would have built — multi-AZ, logged, tagged — without learning the subnet math first.

Verified: reconstructed example passes terraform validate against the real vpc-app module.


<
Previous Post
Vpc No Nat Gateway
>
Next Post
Vpc Multiple Public Route Tables