IG IG <--> PS PS <--> NATG NATG <--> PRS PS --- RTPublic PRS --- RTPrivate VPG <--> ON ON <--> CG VPG <-.-> CG classDef aws fill:#FF9900,stroke:#232F3E,stroke-width:2px; classDef vpc fill:#F58536,stroke:#232F3E,stroke-width:2px; classDef subnet fill:#99C27C,stroke:#232F3E,stroke-width:2px; classDef gateway fill:#FF9900,stroke:#232F3E,stroke-width"> IG IG <--> PS PS <--> NATG NATG <--> PRS PS --- RTPublic PRS --- RTPrivate VPG <--> ON ON <--> CG VPG <-.-> CG classDef aws fill:#FF9900,stroke:#232F3E,stroke-width:2px; classDef vpc fill:#F58536,stroke:#232F3E,stroke-width:2px; classDef subnet fill:#99C27C,stroke:#232F3E,stroke-width:2px; classDef gateway fill:#FF9900,stroke:#232F3E,stroke-width"> IG IG <--> PS PS <--> NATG NATG <--> PRS PS --- RTPublic PRS --- RTPrivate VPG <--> ON ON <--> CG VPG <-.-> CG classDef aws fill:#FF9900,stroke:#232F3E,stroke-width:2px; classDef vpc fill:#F58536,stroke:#232F3E,stroke-width:2px; classDef subnet fill:#99C27C,stroke:#232F3E,stroke-width:2px; classDef gateway fill:#FF9900,stroke:#232F3E,stroke-width">
flowchart TB
    subgraph AWS["AWS Cloud"]
        subgraph VPC["VPC"]
            subgraph PS["Public Subnet"]
                EC2P[EC2 Instance]
            end
            subgraph PRS["Private Subnet"]
                EC2PR[EC2 Instance]
            end
            IG[Internet Gateway]
            NATG[NAT Gateway]
            RTPublic[Route Table Public]
            RTPrivate[Route Table Private]
            VPG[Virtual Private Gateway]
        end
    end
    
    subgraph ON["On-Premise Network"]
        CG[Customer Gateway]
    end
    
    Internet((Internet))
    
    Internet <--> IG
    IG <--> PS
    PS <--> NATG
    NATG <--> PRS
    PS --- RTPublic
    PRS --- RTPrivate
    VPG <--> ON
    ON <--> CG
    VPG <-.-> CG
    
    classDef aws fill:#FF9900,stroke:#232F3E,stroke-width:2px;
    classDef vpc fill:#F58536,stroke:#232F3E,stroke-width:2px;
    classDef subnet fill:#99C27C,stroke:#232F3E,stroke-width:2px;
    classDef gateway fill:#FF9900,stroke:#232F3E,stroke-width:2px;
    classDef routeTable fill:#FFFF99,stroke:#232F3E,stroke-width:2px;
    classDef onPremise fill:#7AA116,stroke:#232F3E,stroke-width:2px;
    classDef internet fill:#232F3E,stroke:#232F3E,stroke-width:2px,color:#FFFFFF;
    
    class AWS,VPC aws;
    class PS,PRS subnet;
    class IG,NATG,VPG gateway;
    class RTPublic,RTPrivate routeTable;
    class ON,CG onPremise;
    class Internet internet;

This Mermaid diagram illustrates the relationship between an AWS VPC and an on-premise network. Here are the main components and their relationships:

  1. AWS Cloud: The overarching framework containing all AWS resources.
  2. VPC (Virtual Private Cloud): An isolated network environment within AWS.
  3. Public Subnet: A subnet with direct access to the Internet.
  4. Private Subnet: A more secure subnet without direct Internet access.
  5. Internet Gateway (IG): The gateway connecting the VPC to the Internet.
  6. NAT Gateway (NATG): A gateway allowing resources in the private subnet to access the Internet.
  7. Route Table Public: Traffic routing rules for the public subnet.
  8. Route Table Private: Traffic routing rules for the private subnet.
  9. Virtual Private Gateway (VPG): The AWS-side gateway connecting the VPC to the on-premise network.
  10. On-Premise Network: The company's own data center or office network.
  11. Customer Gateway (CG): The VPN device or software in the on-premise network.

The arrows in the diagram indicate traffic flow and relationships between components:

This Mermaid diagram helps visualize AWS network components and on-premise connections. The color coding and grouping make it easier to distinguish different components and their relationships: