# surajsant/gcp-multi-tier-vpc-network architecture

> Architecture diagram of the GitHub repository surajsant/gcp-multi-tier-vpc-network, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/surajsant/gcp-multi-tier-vpc-network
- Repository: https://github.com/surajsant/gcp-multi-tier-vpc-network

## Overview

This repository defines a Terraform-managed GCP network. The principal workflow is an operator applying the configuration to provision a custom VPC, three segmented subnet tiers, controlled ingress, and private-tier outbound access through Cloud NAT; Terraform outputs expose selected resource names. The README documents the resource topology and deployment, but no source excerpts were available, so relationships below are limited to those explicitly documented. The proposed load balancer, DNS, VPN, and CI/CD are not part of the current product.

Main entry points: [`main.tf`](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf) (Network Configuration), [`outputs.tf`](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/outputs.tf) (Resource Outputs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Configuration"]
  node_inputs["Terraform Inputs<br/>[variables.tf]"]
end

subgraph group_network["Network Tiers"]
  node_network_config["Network Configuration<br/>[main.tf]"]
  node_vpc["Custom VPC<br/>[main.tf]"]
  node_public_subnet["Public Subnet<br/>[main.tf]"]
  node_private_subnet["Private Subnet<br/>[main.tf]"]
  node_db_subnet["Database Subnet<br/>[main.tf]"]
end

subgraph group_egress["Private Egress"]
  node_router["Cloud Router<br/>[main.tf]"]
  node_nat["Cloud NAT<br/>[main.tf]"]
end

subgraph group_security["Traffic Controls"]
  node_firewalls["Firewall Rules<br/>[main.tf]"]
end

subgraph group_results["Provisioned Results"]
  node_outputs["Resource Outputs<br/>[outputs.tf]"]
end

node_operator(("Operator"))
node_gcp["Google Cloud"]

node_operator -->|"applies"| node_network_config
node_network_config -->|"provisions"| node_vpc
node_network_config -->|"provisions"| node_public_subnet
node_network_config -->|"provisions"| node_private_subnet
node_network_config -->|"provisions"| node_db_subnet
node_network_config -->|"provisions"| node_router
node_network_config -->|"provisions"| node_nat
node_network_config -->|"provisions"| node_firewalls
node_router -->|"attaches"| node_nat
node_nat -->|"serves egress"| node_private_subnet
node_firewalls -->|"allows web"| node_public_subnet
node_firewalls -->|"restricts access"| node_db_subnet
node_network_config -->|"provisions on"| node_gcp
node_network_config -->|"exposes values"| node_outputs

click node_inputs "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/variables.tf"
click node_network_config "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf"
click node_vpc "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf"
click node_public_subnet "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf"
click node_private_subnet "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf"
click node_db_subnet "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf"
click node_router "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf"
click node_nat "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf"
click node_firewalls "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf"
click node_outputs "https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/outputs.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_inputs toneBlue
class node_network_config,node_vpc,node_public_subnet,node_private_subnet,node_db_subnet toneAmber
class node_router,node_nat toneMint
class node_firewalls toneRose
class node_outputs,node_operator,node_gcp toneIndigo
```

## Components

### Configuration

- [Terraform Inputs](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/variables.tf): `variables.tf`

### Network Tiers

- [Network Configuration](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf): `main.tf`
- [Custom VPC](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf): `main.tf`
- [Public Subnet](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf): `main.tf`
- [Private Subnet](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf): `main.tf`
- [Database Subnet](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf): `main.tf`

### Private Egress

- [Cloud Router](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf): `main.tf`
- [Cloud NAT](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf): `main.tf`

### Traffic Controls

- [Firewall Rules](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/main.tf): `main.tf`

### Provisioned Results

- [Resource Outputs](https://github.com/surajsant/gcp-multi-tier-vpc-network/blob/main/outputs.tf): `outputs.tf`

### Other components

- **Operator**
- **Google Cloud**

## Connections

- Operator → Network Configuration: applies (evidence: `README.md`)
- Network Configuration → Custom VPC: provisions (evidence: `README.md`)
- Network Configuration → Public Subnet: provisions (evidence: `README.md`)
- Network Configuration → Private Subnet: provisions (evidence: `README.md`)
- Network Configuration → Database Subnet: provisions (evidence: `README.md`)
- Network Configuration → Cloud Router: provisions (evidence: `README.md`)
- Network Configuration → Cloud NAT: provisions (evidence: `README.md`)
- Network Configuration → Firewall Rules: provisions (evidence: `README.md`)
- Cloud Router → Cloud NAT: attaches (evidence: `README.md`)
- Cloud NAT → Private Subnet: serves egress (evidence: `README.md`)
- Firewall Rules → Public Subnet: allows web (evidence: `README.md`)
- Firewall Rules → Database Subnet: restricts access (evidence: `README.md`)
- Network Configuration → Google Cloud: provisions on (evidence: `README.md`)
- Network Configuration → Resource Outputs: exposes values (evidence: `README.md`)
