How nicolgit/hub-and-spoke-playground works
Project Type and Purpose
• This is an infrastructure-as-code repository for deploying Azure hub-and-spoke network topologies and on-premise simulations. It uses ARM/Bicep templates to spin up VNets, subnets, firewalls, gateways, VMs, and optional services.
• The README describes multiple “playgrounds” (hub-01, hub-02, on-prem, on-prem-2, any-to-any routing, S2S VPN) plus dozens of step-by-step network scenarios.
High-Level File Structure & Architectural Patterns
• Top-level directories:
• hub-01-bicep, hub-02-bicep, on-prem-bicep, on-prem-2-bicep, any-to-any-bicep, s2s-vpn-bicep (each contains Bicep/JSON templates for a single network deployment).
• scenarios (Markdown docs with configuration steps for each network scenario).
• Architecture pattern: Hub-and-Spoke (central “hub” VNet hosting shared services & inspection, multiple “spoke” VNets, plus simulated on-prem VNets connected via VPN Gateway).
• Infrastructure defined declaratively (Bicep → ARM JSON), emphasizing repeatable, parameterized deployments.
Key Components
a. Azure Virtual Networks
• hub-lab-net / hub-lab-02-net (hub VNets, each with subnets: default, AzureFirewallSubnet, AzureBastionSubnet, GatewaySubnet)
• spoke-0x VNets (each with two subnets for VMs)
• on-prem-net / on-prem-2-net (simulated on-prem VNets, each with default, Bastion, Gateway subnets)
b. Network Appliances & Services
• Azure Firewall Premium/Standard in its subnet
• Azure Bastion in its subnet (secure SSH/RDP jumpbox)
• Azure VPN Gateway in GatewaySubnet (handles vNet-to-vNet or site-to-site IPSec connections)
• Application Gateway, API Management, Azure OpenAI, Elastic SAN (optional services deployed in specific scenarios)
c. Compute
• VMs in each spoke (Windows Server or Linux) and in on-prem nets (w10-onprem-vm, lin-onprem-vm)
d. Routing & Policies
• UDRs & route tables (e.g., any-to-any routing, forced-tunnel to Azure Firewall)
• Azure Firewall policies and IP Groups
Interactions & Data Flows
• IPSec tunnels or vNet-to-vNet gateway connections between on-prem VNets and hub VNet.
• user/SSH/RDP traffic flowing through Bastion into VMs.
• Outbound traffic from spokes routed to Azure Firewall, then to Internet or on-prem.
Architectural Patterns & Principles
• Separation of Concerns: isolate shared services (firewall, bastion, gateway) in hub; workloads in spokes.
• Least Privilege: route only required traffic through inspection points (Azure Firewall policies).
• Scalability & Modularity: parameterized Bicep modules for hub, spoke, on-prem, enabling reuse.
• Idempotence & Repeatability: declarative templates ensure consistent deployments across subscriptions/regions.