mbakunas / Azure-HubSpoke

0 stars 0 forks source link

A set of ARM templates that deploys a hub-spoke VNet environment

The Design

VNet Diagram

Hub-Spoke Architecture

Hub VNet

The hub VNet has the following subnets:

Spoke VNet(s)

This solution deploys spokes that with the following subnets:

Network Security Groups (NSGs)

Edge Security

Egress

Outbound edge security is handled by the Azure Firewall. If deployed, a route table is deployed directing all Internet-bound traffic to the Azure Firewall which has the following default rules:

If the firewall is deployed, there are IP groups deployed that represent the following:

Ingress

The intent is that the inbound edge security will be handled by app gateways running WAF, hence the option for an app gateway subnet in the spokes.

Role-Based Access Control (RBAC)

RBAC is set as follows:

DDoS Protection

This solution optionally deploys a DDoS Protection Plan. Since a single DDoS Protection Plan can be used across multiple subscriptions in a tenant, the solution can use an existing Plan.

Resource Locks

The last step in the deployment is to place a DoNotDelete lock on all the resource groups to which this solution deploys resources.

Forced Naming Convention

This solution uses the following naming convention:

Resource Type Naming convention Example
Virtual Network* [HUB/SPOKE-PROD/SPOKE-NONPROD]-[Region]-## HUB-EastUS2-01
Subnet [Descriptive Text]-[Address Space] Infra-10.64.0.192-27
VNet Gateway [VNet Name]-GW-# HUB-EastUS2-01-GW-1
Network Security Group [Subnet Name]-NSG Infra-10.64.0.192-27-NSG
Azure Bastion [VNet Name]-Bastion HUB-EastUS2-01-Bastion
Azure Firewall [VNet Name]-Firewall HUB-EastUS2-01-Firewall
IP Groups [VNet Name]-[Subnet Name]-IpGroup HUB-EastUS2-01-Infra-10.64.0.192-27-IpGroup
Public IP Address [Resource Name]-IP HUB-EastUS2-01-Firewall-IP
Route Table* [Descriptive Text]-[Region]-## RouteTable-EastUS2-01

* Naming convention is recommended but not forced by the solution.

Using the Solution

Limitations

This set of templates is not truly idempotent in that if VMs are attached to any of the VNets (or the ExpressRoute gateway) a redeployment will fail. This situation is due to the way the VNets and subnets are deployed. In order to make some of the subnets optional, the subnets are deployed as separate resources from the VNet; the VNets are deployed without any subnets. A subsequent redeploy will attempt to delete the subnets, which will fail if anything is attached.

Pre-Requisites

Subscription and resource groups

Azure deployments must be deployed to an existing resource group in an existing subecription. The hub VNet will be deployed to this subscription/resource group combination. The spoke VNet(s) can be deployed to any existing subscription/resource group (requires at least contributor access).