# xxradar/aws_route_server_demo architecture

> Architecture diagram of the GitHub repository xxradar/aws_route_server_demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xxradar/aws_route_server_demo
- Repository: https://github.com/xxradar/aws_route_server_demo

## Overview

##### Project Type and Purpose
- Project Type: AWS infrastructure configuration tutorial
- Purpose: Walk through enabling dynamic BGP-based routing in a single VPC using AWS VPC Route Server and peering to external network devices (e.g., FortiGate).

##### Main Components
a. IAM Layer
– RouteServerPolicy (JSON)
– TrustPolicy (JSON)
– IAM Role (RouteServerRole) that assumes trust policy and attaches the RouteServerPolicy
b. VPC & Subnets
– VPC (e.g., vpc-571faf2e)
– One or more subnets (e.g., subnet-7a0ae703)
c. AWS VPC Route Server
– The managed Route Server instance (rs-xxxxx)
– Associated ENI endpoints (rse-xxxxx) placed in subnets
d. Route Tables
– One or more route tables (rtb-xxxxx) with propagation enabled
e. External Network Devices (BGP Peers)
– Example device with IP 10.0.2.3 initiating BGP session
– BGP options (PeerAsn=65001, liveness detection=bfd)
f. Dynamic Routing Flow
– BGP sessions between Route Server ENI and external device
– Route-Server propagates learned routes into AWS route tables

##### Relationships & Interactions
- IAM Role → AWS EC2 Create/Manage Route Server
- VPC ↔ Associate Route Server
- Subnet → Route Server Endpoint (ENI)
- Route Server ↔ Route Tables (propagation in/out)
- ENI ↔ External Device (BGP peer over TCP 179)

##### Architectural Patterns & Principles
– Centralized dynamic routing: the Route Server acts as a hub for all subnet route exchanges.
– Separation of concerns: IAM policies/roles distinct from networking resources.
– AWS-managed service reduces customer-side complexity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "IAM Layer"
        Policy["RouteServerPolicy"]:::iam
        Trust["TrustPolicy"]:::iam
        Role["RouteServerRole"]:::iam
    end

    subgraph "VPC & Network"
        VPC["VPC vpc-571faf2e"]:::vpc
        subgraph "Subnets"
            Subnet["subnet-7a0ae703"]:::subnet
            ENI["Route Server ENI<br/>rse-xxxxx"]:::eni
        end
        RS["VPC Route Server<br/>rs-xxxxx"]:::compute
        RT["Route Table<br/>rtb-xxxxx"]:::routetable
    end

    subgraph "Data Plane"
        External["External Device<br/>10.0.2.3<br/>(BGP Peer)"]:::external
    end

    Role -->|assumes| Trust
    Role -->|attached| Policy
    Role -->|create/manage| RS

    VPC --> RS
    RS -->|associated ENI| ENI
    Subnet --> ENI
    RS -->|propagate routes| RT
    RT -->|applied to subnets| Subnet

    ENI -->|"BGP session (179/TCP)"| External
    External -->|"BGP session (179/TCP)"| ENI

    click Policy "https://github.com/xxradar/aws_route_server_demo/blob/main/route-server-policy.json"
    click Trust "https://github.com/xxradar/aws_route_server_demo/blob/main/trust-policy.json"
    click Role "https://github.com/xxradar/aws_route_server_demo/blob/main/README.md"

    classDef iam fill:#f9f,stroke:#333,stroke-width:1px
    classDef vpc fill:#ccf,stroke:#333,stroke-width:1px
    classDef subnet fill:#cfc,stroke:#333,stroke-width:1px
    classDef eni fill:#fcf,stroke:#333,stroke-width:1px
    classDef compute fill:#f96,stroke:#333,stroke-width:1px
    classDef routetable fill:#cff,stroke:#333,stroke-width:1px
    classDef external fill:#fcc,stroke:#333,stroke-width:1px
```
