Infra & Cloud
terraform
Advanced
AWS VPC with Public and Private Subnets
Terraform VPC module with NAT gateway, route tables and subnet tagging for EKS.
terraform
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.0"
name = "myapp-vpc"
cidr = "10.0.0.0/16"
azs = ["us-east-1a", "us-east-1b"]
private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
public_subnets = ["10.0.101.0/24", "10.0.102.0/24"]
enable_nat_gateway = true
single_nat_gateway = true
tags = { Environment = var.env }
}
Prerequisites
- terraform >= 1.0
- AWS provider
- terraform-aws-modules/vpc
Pro Tips
- → Use single_nat_gateway=false for HA in production.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- terraform
- Level
- Advanced
- Read time
- 5 min
- Published
- Jul 2026
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
AWS S3 Static Website
Terraform module to provision an S3 bucket for static website hosting.
terraform
·
Intermediate
AWS RDS Postgres Terraform
Terraform resource for an RDS PostgreSQL instance with encryption and backup.
terraform
·
Intermediate
ECS Task Force Stop
Force-stop all running ECS tasks in a service for emergency rollback.
bash
·
Intermediate