TExcelTAD
Home › Azure & Google Cloud for AWS Users › Peering, Hubs and Private Endpoints

Peering, Hubs and Private Endpoints

Once you have more than one network, you need to connect them: to each other, to on-premises, and privately to managed services. The building blocks line up closely across clouds; the topology habits differ because of the regional vs global network scope.

On AWS this is… VPC peering, Transit Gateway, Site-to-Site VPN and Direct Connect, and VPC endpoints / PrivateLink, touched on in Amazon VPC and Subnets and Route Tables and NAT.

The building blocks

Need AWS Azure Google Cloud
Connect two networks VPC peering VNet peering (same or different regions: "global VNet peering") VPC Network Peering
Is peering transitive? no no (route through a hub firewall/gateway, or use Virtual Network Manager / Virtual WAN) no
Hub for many networks Transit Gateway hub VNet + peering, or Virtual WAN, or Azure Virtual Network Manager Network Connectivity Center, or a Shared VPC so there's only one network
Site-to-site VPN Site-to-Site VPN VPN Gateway Cloud VPN (HA VPN) with Cloud Router (BGP)
Dedicated line Direct Connect ExpressRoute Cloud Interconnect (Dedicated / Partner)
Private access to a provider service gateway endpoints (S3, DynamoDB), interface endpoints service endpoints (subnet-level), private endpoints (a private IP for one resource) Private Google Access (subnet-level), Private Service Connect endpoints
Publish your own service privately PrivateLink endpoint service Private Link service Private Service Connect published service
Private DNS Route 53 private hosted zones Private DNS zones linked to VNets Cloud DNS private zones bound to networks

Hub and spoke

The most common enterprise layout is the same on AWS and Azure: a hub network holds shared things (firewall, VPN/ExpressRoute gateway, DNS resolvers, Bastion), spoke networks hold workloads, and spokes peer only with the hub. Because peering isn't transitive, spoke-to-spoke traffic goes through the hub's firewall via a UDR, which is also where you inspect it.

On Google Cloud the same goal is often reached differently: one Shared VPC host project per environment, with workload projects attached as service projects. There are no spokes to peer, because everyone uses subnets of one global network, and firewall rules (or policies) do the segmentation. Use Network Connectivity Center when you really need many separate networks or hybrid hubs.

text
Azure hub and spoke                         Google Cloud Shared VPC
-------------------                         -----------------------
   vnet-spoke-shop ──peer──┐                  host project: net-prod
                           ├── vnet-hub         └─ VPC network shared-prod (global)
   vnet-spoke-data ──peer──┘   (Azure Firewall,       ├─ subnet shop-ew1  ← used by project shop-prod
                                VPN gateway,          ├─ subnet data-ew1  ← used by project data-prod
                                Bastion)              └─ Cloud VPN / Interconnect, Cloud NAT

Private endpoints for managed services

By default, PaaS services such as Azure Storage, Azure SQL, Cloud SQL (with a public IP) or Cloud Storage are reached on public endpoints (protected by authentication and service firewalls). To keep traffic on private addresses:

Azure Google Cloud
Subnet-wide, simple service endpoint: traffic to e.g. Microsoft.Storage from the subnet uses the Azure backbone and the service can allow-list the subnet; the service keeps its public IP Private Google Access: VMs without external IPs reach Google APIs
Per resource, a private IP in your subnet private endpoint (NIC with a private IP for one storage account, database, vault…) + private DNS zone privatelink.blob.core.windows.net Private Service Connect endpoint for Google APIs or a published service; private services access for Cloud SQL, Memorystore and others
Then disable public network access on the resource create Cloud SQL with private IP only (--no-assign-ip)

The DNS part is where private endpoints fail in practice: clients must resolve stshopprod.blob.core.windows.net to the private IP, which needs the privatelink private DNS zone linked to every VNet (and forwarding from on-premises DNS). Test name resolution first when "the private endpoint doesn't work".

Model: who can reach whom?

Peering isn't transitive on any of the three clouds. This model computes reachability with and without a hub that routes between spokes:

python · try it yourself
from itertools import permutations

peerings = {("hub", "spoke-shop"), ("hub", "spoke-data"), ("hub", "onprem-vpn")}
peered = peerings | {(b, a) for a, b in peerings}

def reachable(a, b, hub_routes):
    if (a, b) in peered:
        return "direct peering"
    if hub_routes and (a, "hub") in peered and ("hub", b) in peered:
        return "via the hub (UDR to firewall, or gateway transit)"
    return "NO ROUTE"

nets = ["spoke-shop", "spoke-data", "onprem-vpn"]
for hub_routes in (False, True):
    print("hub routes between spokes:", hub_routes)
    for a, b in permutations(nets, 2):
        if a < b:
            print(f"   {a:<11} -> {b:<11} {reachable(a, b, hub_routes)}")
hub routes between spokes: False
   spoke-data  -> spoke-shop  NO ROUTE
   onprem-vpn  -> spoke-shop  NO ROUTE
   onprem-vpn  -> spoke-data  NO ROUTE
hub routes between spokes: True
   spoke-data  -> spoke-shop  via the hub (UDR to firewall, or gateway transit)
   onprem-vpn  -> spoke-shop  via the hub (UDR to firewall, or gateway transit)
   onprem-vpn  -> spoke-data  via the hub (UDR to firewall, or gateway transit)

(Azure has one exception for on-premises: with gateway transit, a spoke peered to a hub with a VPN/ExpressRoute gateway can use that gateway directly, through the peering options "allow gateway transit" on the hub side and "use remote gateways" on the spoke side.)

Commands

Sample sessions:

bash
# Azure: peer hub and spoke (both directions are needed)
az network vnet peering create -g rg-net -n hub-to-shop --vnet-name vnet-hub \
    --remote-vnet /subscriptions/S/resourceGroups/rg-shop-net/providers/Microsoft.Network/virtualNetworks/vnet-spoke-shop \
    --allow-vnet-access --allow-forwarded-traffic --allow-gateway-transit
az network vnet peering create -g rg-shop-net -n shop-to-hub --vnet-name vnet-spoke-shop \
    --remote-vnet /subscriptions/S/resourceGroups/rg-net/providers/Microsoft.Network/virtualNetworks/vnet-hub \
    --allow-vnet-access --allow-forwarded-traffic --use-remote-gateways

# Azure: private endpoint for a storage account's blob service
az network private-endpoint create -g rg-shop-prod-data -n pe-stshopprod-blob \
    --vnet-name vnet-spoke-shop --subnet snet-endpoints \
    --private-connection-resource-id "$(az storage account show -n stshopprod -g rg-shop-prod-data --query id -o tsv)" \
    --group-id blob --connection-name stshopprod-blob

# Google Cloud: peer two networks (also both directions)
gcloud compute networks peerings create shop-to-data --network=shop-vpc \
    --peer-project=data-prod-1177 --peer-network=data-vpc

Test yourself

Spoke A and spoke B are each peered with a hub VNet. Can A reach B through the peerings alone?

  1. Yes, peering is transitive
  2. No: peering is not transitive; route through a hub firewall/appliance or connect them directly
  3. Only in the same region
  4. Only with service endpoints

What gives a single Azure storage account a private IP address inside your VNet?

  1. A service endpoint
  2. A private endpoint
  3. A NAT Gateway
  4. A UDR

A common Google Cloud alternative to hub-and-spoke peering inside one environment is…

  1. Shared VPC: one host project network used by many service projects
  2. One VPC per zone
  3. Cloud NAT
  4. Private Google Access