vpc
Some text goes here
module "vpc" {
source = "registry.patterneddesigns.ca/patterneddesigns/vpc/aws"
version = "0.1.0"
# Required inputs
name = "..."
vpc_cidr = "..."
availability_zones = "..."
}Overview
The vpc module creates a production-ready AWS VPC with:
- Public and private subnets across multiple availability zones
- NAT gateways for private subnet internet access
- DNS hostnames and resolution enabled
- Optional IPv6 support
- Proper route tables and internet gateway
Category: Networking Provider: AWS Latest Version: 1.2.0
Quick Start
module "vpc" {
source = "registry.patterneddesigns.ca/patterneddesigns/vpc/aws"
version = "1.2.0"
availability_zones = ["us-east-1a", "us-east-1b", "us-east-1c"]
}
Key Features
Multi-AZ Architecture
Subnets are automatically distributed across specified availability zones for high availability:
module "vpc" {
source = "registry.patterneddesigns.ca/patterneddesigns/vpc/aws"
version = "1.2.0"
vpc_cidr = "10.0.0.0/16"
availability_zones = ["us-east-1a", "us-east-1b", "us-east-1c"]
}
NAT Gateway Options
Control NAT gateway deployment for cost optimization:
# High availability (default): One NAT gateway per AZ
module "vpc_ha" {
source = "registry.patterneddesigns.ca/patterneddesigns/vpc/aws"
version = "1.2.0"
availability_zones = ["us-east-1a", "us-east-1b"]
enable_nat_gateway = true
single_nat_gateway = false # One per AZ
}
# Cost-optimized: Single NAT gateway
module "vpc_dev" {
source = "registry.patterneddesigns.ca/patterneddesigns/vpc/aws"
version = "1.2.0"
availability_zones = ["us-east-1a", "us-east-1b"]
enable_nat_gateway = true
single_nat_gateway = true # Shared across AZs
}
# No NAT: Private subnets without internet access
module "vpc_isolated" {
source = "registry.patterneddesigns.ca/patterneddesigns/vpc/aws"
version = "1.2.0"
availability_zones = ["us-east-1a", "us-east-1b"]
enable_nat_gateway = false
}
IPv6 Support
Enable dual-stack networking:
module "vpc" {
source = "registry.patterneddesigns.ca/patterneddesigns/vpc/aws"
version = "1.2.0"
availability_zones = ["us-east-1a", "us-east-1b"]
enable_ipv6 = true
}
Documentation
Registry
Inputs
Name of the VPC. Used for resource naming and SSM parameter paths.
The IPv4 CIDR block for the VPC
List of availability zones for subnet distribution
Enable DNS hostnames in the VPC
Enable NAT gateways for private subnet internet access
Use a single NAT gateway instead of one per AZ
Enable IPv6 support for the VPC and subnets
Tags to apply to all resources
Publish VPC metadata to SSM Parameter Store for discovery by other modules
Outputs
The ID of the VPC
The IPv4 CIDR block of the VPC
The IPv6 CIDR block of the VPC (if enabled)
List of public subnet IDs
List of private subnet IDs
List of NAT gateway IDs
The ID of the internet gateway
The ID of the public route table
List of private route table IDs
SSM parameter paths where VPC metadata is published