# hashicorp/terraform-aws-vpc architecture

> Architecture diagram of the GitHub repository hashicorp/terraform-aws-vpc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hashicorp/terraform-aws-vpc
- Repository: https://github.com/hashicorp/terraform-aws-vpc

## Overview

This is a Terraform module for provisioning AWS VPC networking. The principal workflow is a caller supplying network and feature configuration, then the module creating the requested VPC resources and exposing outputs. Its documented capabilities span subnet tiers, routing and NAT, gateways, network ACLs, service endpoints, and subnet groups, as well as default-VPC and DHCP options management. Source excerpts were not provided, so component links rely on README statements; paths identify the relevant files from the tree.

Main entry points: [`main.tf`](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf) (VPC), [`outputs.tf`](https://github.com/hashicorp/terraform-aws-vpc/blob/master/outputs.tf) (Module outputs), [`vpc-endpoints.tf`](https://github.com/hashicorp/terraform-aws-vpc/blob/master/vpc-endpoints.tf) (VPC endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["VPC foundation"]
  node_vpc["VPC<br/>[main.tf]"]
  node_outputs["Module outputs<br/>[outputs.tf]"]
end

subgraph group_subnets["Subnets and routing"]
  node_subnets["Subnet tiers<br/>[main.tf]"]
  node_routes["Routes and tables<br/>[main.tf]"]
end

subgraph group_connectivity["Connectivity features"]
  node_igw["Internet gateway<br/>[main.tf]"]
  node_nat["NAT gateways<br/>[main.tf]"]
  node_vpn["VPN gateway<br/>[main.tf]"]
  node_endpoints["VPC endpoints<br/>[vpc-endpoints.tf]"]
end

subgraph group_support["Supporting resources"]
  node_nacl["Network ACLs<br/>[main.tf]"]
  node_subnet_groups["Service subnet groups<br/>[main.tf]"]
  node_dhcp["DHCP options<br/>[main.tf]"]
  node_default_vpc["Default VPC<br/>[main.tf]"]
  node_default_acl["Default network ACL<br/>[main.tf]"]
end

node_caller(("Terraform caller"))
node_aws{{"AWS"}}

node_caller -->|"configures"| node_vpc
node_vpc -->|"creates"| node_subnets
node_vpc -->|"creates"| node_routes
node_vpc -->|"creates"| node_igw
node_vpc -->|"creates"| node_nat
node_vpc -->|"creates"| node_vpn
node_vpc -->|"creates"| node_endpoints
node_vpc -->|"creates"| node_nacl
node_vpc -->|"creates"| node_subnet_groups
node_vpc -->|"creates"| node_dhcp
node_vpc -->|"manages"| node_default_vpc
node_vpc -->|"manages"| node_default_acl
node_subnets -->|"routes via"| node_nat
node_vpc -->|"provisions resources"| node_aws
node_vpc -->|"exposes"| node_outputs

click node_vpc "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_outputs "https://github.com/hashicorp/terraform-aws-vpc/blob/master/outputs.tf"
click node_subnets "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_routes "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_igw "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_nat "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_vpn "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_endpoints "https://github.com/hashicorp/terraform-aws-vpc/blob/master/vpc-endpoints.tf"
click node_nacl "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_subnet_groups "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_dhcp "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_default_vpc "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"
click node_default_acl "https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_vpc,node_outputs toneBlue
class node_subnets,node_routes toneAmber
class node_igw,node_nat,node_vpn,node_endpoints toneMint
class node_nacl,node_subnet_groups,node_dhcp,node_default_vpc,node_default_acl toneRose
class node_caller,node_aws toneIndigo
```

## Components

### VPC foundation

- [VPC](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [Module outputs](https://github.com/hashicorp/terraform-aws-vpc/blob/master/outputs.tf): `outputs.tf`

### Subnets and routing

- [Subnet tiers](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [Routes and tables](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`

### Connectivity features

- [Internet gateway](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [NAT gateways](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [VPN gateway](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [VPC endpoints](https://github.com/hashicorp/terraform-aws-vpc/blob/master/vpc-endpoints.tf): `vpc-endpoints.tf`

### Supporting resources

- [Network ACLs](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [Service subnet groups](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [DHCP options](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [Default VPC](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`
- [Default network ACL](https://github.com/hashicorp/terraform-aws-vpc/blob/master/main.tf): `main.tf`

### Other components

- **Terraform caller**
- **AWS**

## Connections

- Terraform caller → VPC: configures (evidence: `README.md`)
- VPC → Subnet tiers: creates (evidence: `README.md`)
- VPC → Routes and tables: creates (evidence: `README.md`)
- VPC → Internet gateway: creates (evidence: `README.md`)
- VPC → NAT gateways: creates (evidence: `README.md`)
- VPC → VPN gateway: creates (evidence: `README.md`)
- VPC → VPC endpoints: creates (evidence: `README.md`)
- VPC → Network ACLs: creates (evidence: `README.md`)
- VPC → Service subnet groups: creates (evidence: `README.md`)
- VPC → DHCP options: creates (evidence: `README.md`)
- VPC → Default VPC: manages (evidence: `README.md`)
- VPC → Default network ACL: manages (evidence: `README.md`)
- Subnet tiers → NAT gateways: routes via (evidence: `README.md`)
- VPC → AWS: provisions resources (evidence: `README.md`)
- VPC → Module outputs: exposes (evidence: `README.md`)
