# cloudposse/terraform-aws-vpc architecture

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

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

## Overview

##### Main Components

a. Core VPC Components:
- VPC (Primary Container)
- Internet Gateway
- IPv6 Egress-Only Internet Gateway (Optional)
- Default Network ACL
- Default Route Table
- Default Security Group

b. Network Components:
- IPv4 CIDR Blocks (Primary and Additional)
- IPv6 CIDR Blocks (Optional)
- IPAM Integration (Optional)

**┌─────────────────────────────────── AWS Region ───────────────────────────────────┐**

- ┌────────────────────────────────── VPC ─────────────────────────────────┐     │

- ┌─────────────────┐    ┌────────────────┐    ┌────────────────────┐  │     │
- Primary CIDR    │    │ Additional      │    │ IPv6 CIDR Blocks   │  │     │
- Block           │    │ CIDR Blocks     │    │ (Optional)         │  │     │
- ┘    └────────────────┘    └────────────────────┘  │     │

- ┌─────────────────┐    ┌────────────────┐    ┌────────────────────┐  │     │
- Default         │    │ Default        │    │ Default Security   │  │     │
- Network ACL     │    │ Route Table    │    │ Group             │  │     │
- ┘    └────────────────┘    └────────────────────┘  │     │

- ┌─────────────────┐    ┌────────────────────────┐                             │
- Internet        │    │ IPv6 Egress-Only       │                             │
- Gateway         │    │ Internet Gateway       │                             │
- ┘    └────────────────────────┘                             │

- ┘

##### Metadata Section
A section showing:
- VPC ID
- Region
- Environment tags
- Other relevant tags

- Nested containers
- Different line styles
- Export to common formats

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph AWS["AWS Region fa:fa-aws"]
        subgraph VPC["VPC - 10.0.0.0/16 fa:fa-network-wired"]
            PCIDR["Primary CIDR<br/>10.0.0.0/16<br/>fa:fa-network-wired"]:::networking
            ACIDR["Additional CIDR<br/>172.16.0.0/16<br/>fa:fa-network-wired"]:::networking
            IPV6["IPv6 (Optional)<br/>fa:fa-network-wired"]:::networking-optional
            
            NACL["Network ACL<br/>fa:fa-shield-alt"]:::security
            SG["Security Group<br/>fa:fa-lock"]:::security
            RT["Route Table<br/>fa:fa-route"]:::security
            
            DOPT["DNS Options<br/>fa:fa-dns"]:::networking
            
            PCIDR --> |animate| NACL
            ACIDR --> |animate| NACL
            IPV6 -.-> |animate| NACL
            NACL --> |animate| RT
            RT --> |animate| SG
        end
        
        IGW["Internet Gateway<br/>fa:fa-globe"]:::gateway
        EIGW["IPv6 Egress Gateway<br/>fa:fa-globe"]:::gateway-optional
        
        subgraph ENDPOINTS
            S3EP["S3 Endpoint<br/>fa:fa-database"]:::endpoint
            DDBEP["DynamoDB Endpoint<br/>fa:fa-table"]:::endpoint
        end
        
        IGW --> |animate| VPC
        EIGW -.-> |animate| VPC
        ENDPOINTS --> |animate| VPC
    end
    
    subgraph Components
        MAIN["Core VPC<br/>fa:fa-cogs"]:::core
        VARS["Config<br/>fa:fa-wrench"]:::core
        OUT["Outputs<br/>fa:fa-file-export"]:::core
        VPCE["Endpoints<br/>fa:fa-plug"]:::module
    end
    
    click MAIN "https://github.com/cloudposse/terraform-aws-vpc/blob/main/main.tf"
    click VARS "https://github.com/cloudposse/terraform-aws-vpc/blob/main/variables.tf"
    click OUT "https://github.com/cloudposse/terraform-aws-vpc/blob/main/outputs.tf"
    click VPCE "https://github.com/cloudposse/terraform-aws-vpc/tree/main/modules/vpc-endpoints/"
    
    classDef networking fill:#90EE90,stroke:#333,stroke-width:2px
    classDef networking-optional fill:#90EE90,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5
    classDef security fill:#FFA500,stroke:#333,stroke-width:2px
    classDef gateway fill:#FFFF00,stroke:#333,stroke-width:2px
    classDef gateway-optional fill:#FFFF00,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:2px
    classDef module fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef endpoint fill:#FF69B4,stroke:#333,stroke-width:2px
```
