Share via


Microsoft.Network expressRouteGateways/expressRouteConnections 2018-10-01

Bicep resource definition

The expressRouteGateways/expressRouteConnections resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Network/expressRouteGateways/expressRouteConnections resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Network/expressRouteGateways/expressRouteConnections@2018-10-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    authorizationKey: 'string'
    expressRouteCircuitPeering: {
      id: 'string'
    }
    routingWeight: int
  }
}

Property Values

Microsoft.Network/expressRouteGateways/expressRouteConnections

Name Description Value
name The resource name string (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: expressRouteGateways
properties Properties of the express route connection. ExpressRouteConnectionProperties

ExpressRouteCircuitPeeringId

Name Description Value
id The ID of the ExpressRoute circuit peering. string

ExpressRouteConnectionProperties

Name Description Value
authorizationKey Authorization key to establish the connection. string
expressRouteCircuitPeering The ExpressRoute circuit peering. ExpressRouteCircuitPeeringId (required)
routingWeight The routing weight associated to the connection. int

Usage Examples

Bicep Samples

A basic example of deploying Express Route Connection.

param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The shared key for the ExpressRoute connection')
param sharedKey string

resource expressrouteport 'Microsoft.Network/ExpressRoutePorts@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    bandwidthInGbps: 10
    encapsulation: 'Dot1Q'
    peeringLocation: 'CDC-Canberra'
  }
}

resource expressRouteCircuit 'Microsoft.Network/expressRouteCircuits@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    authorizationKey: ''
    bandwidthInGbps: 5
    expressRoutePort: {
      id: expressrouteport.id
    }
  }
  sku: {
    family: 'MeteredData'
    name: 'Premium_MeteredData'
    tier: 'Premium'
  }
}

resource expressRouteGateway 'Microsoft.Network/expressRouteGateways@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    allowNonVirtualWanTraffic: false
    autoScaleConfiguration: {
      bounds: {
        min: 1
      }
    }
    virtualHub: {
      id: virtualHub.id
    }
  }
}

resource virtualHub 'Microsoft.Network/virtualHubs@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    addressPrefix: '10.0.1.0/24'
    hubRoutingPreference: 'ExpressRoute'
    virtualRouterAutoScaleConfiguration: {
      minCapacity: 2
    }
    virtualWan: {
      id: virtualWan.id
    }
  }
}

resource virtualWan 'Microsoft.Network/virtualWans@2022-07-01' = {
  name: resourceName
  location: location
  properties: {
    allowBranchToBranchTraffic: true
    disableVpnEncryption: false
    office365LocalBreakoutCategory: 'None'
    type: 'Standard'
  }
}

resource expressRouteConnection 'Microsoft.Network/expressRouteGateways/expressRouteConnections@2022-07-01' = {
  parent: expressRouteGateway
  name: resourceName
  properties: {
    enableInternetSecurity: false
    expressRouteCircuitPeering: {
      id: peering.id
    }
    expressRouteGatewayBypass: false
    routingConfiguration: {}
    routingWeight: 0
  }
}

resource peering 'Microsoft.Network/expressRouteCircuits/peerings@2022-07-01' = {
  parent: expressRouteCircuit
  name: 'AzurePrivatePeering'
  properties: {
    azureASN: 12076
    gatewayManagerEtag: ''
    peerASN: 100
    peeringType: 'AzurePrivatePeering'
    primaryPeerAddressPrefix: '192.168.1.0/30'
    secondaryPeerAddressPrefix: '192.168.2.0/30'
    sharedKey: null
    state: 'Enabled'
    vlanId: 100
  }
}

ARM template resource definition

The expressRouteGateways/expressRouteConnections resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Network/expressRouteGateways/expressRouteConnections resource, add the following JSON to your template.

{
  "type": "Microsoft.Network/expressRouteGateways/expressRouteConnections",
  "apiVersion": "2018-10-01",
  "name": "string",
  "properties": {
    "authorizationKey": "string",
    "expressRouteCircuitPeering": {
      "id": "string"
    },
    "routingWeight": "int"
  }
}

Property Values

Microsoft.Network/expressRouteGateways/expressRouteConnections

Name Description Value
apiVersion The api version '2018-10-01'
name The resource name string (required)
properties Properties of the express route connection. ExpressRouteConnectionProperties
type The resource type 'Microsoft.Network/expressRouteGateways/expressRouteConnections'

ExpressRouteCircuitPeeringId

Name Description Value
id The ID of the ExpressRoute circuit peering. string

ExpressRouteConnectionProperties

Name Description Value
authorizationKey Authorization key to establish the connection. string
expressRouteCircuitPeering The ExpressRoute circuit peering. ExpressRouteCircuitPeeringId (required)
routingWeight The routing weight associated to the connection. int

Usage Examples

Terraform (AzAPI provider) resource definition

The expressRouteGateways/expressRouteConnections resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Network/expressRouteGateways/expressRouteConnections resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Network/expressRouteGateways/expressRouteConnections@2018-10-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      authorizationKey = "string"
      expressRouteCircuitPeering = {
        id = "string"
      }
      routingWeight = int
    }
  }
}

Property Values

Microsoft.Network/expressRouteGateways/expressRouteConnections

Name Description Value
name The resource name string (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: expressRouteGateways
properties Properties of the express route connection. ExpressRouteConnectionProperties
type The resource type "Microsoft.Network/expressRouteGateways/expressRouteConnections@2018-10-01"

ExpressRouteCircuitPeeringId

Name Description Value
id The ID of the ExpressRoute circuit peering. string

ExpressRouteConnectionProperties

Name Description Value
authorizationKey Authorization key to establish the connection. string
expressRouteCircuitPeering The ExpressRoute circuit peering. ExpressRouteCircuitPeeringId (required)
routingWeight The routing weight associated to the connection. int

Usage Examples

Terraform Samples

A basic example of deploying Express Route Connection.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

variable "shared_key" {
  type        = string
  description = "The shared key for the ExpressRoute connection"
  sensitive   = true
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "ExpressRoutePort" {
  type      = "Microsoft.Network/ExpressRoutePorts@2022-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      bandwidthInGbps = 10
      encapsulation   = "Dot1Q"
      peeringLocation = "CDC-Canberra"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "virtualWan" {
  type      = "Microsoft.Network/virtualWans@2022-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      allowBranchToBranchTraffic     = true
      disableVpnEncryption           = false
      office365LocalBreakoutCategory = "None"
      type                           = "Standard"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "virtualHub" {
  type      = "Microsoft.Network/virtualHubs@2022-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      addressPrefix        = "10.0.1.0/24"
      hubRoutingPreference = "ExpressRoute"
      virtualRouterAutoScaleConfiguration = {
        minCapacity = 2
      }
      virtualWan = {
        id = azapi_resource.virtualWan.id
      }
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "expressRouteCircuit" {
  type      = "Microsoft.Network/expressRouteCircuits@2022-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      authorizationKey = ""
      bandwidthInGbps  = 5
      expressRoutePort = {
        id = azapi_resource.ExpressRoutePort.id
      }
    }
    sku = {
      family = "MeteredData"
      name   = "Premium_MeteredData"
      tier   = "Premium"
    }
  }
  schema_validation_enabled = false
  ignore_casing             = true
  response_export_values    = ["*"]
}

resource "azapi_resource" "peering" {
  type      = "Microsoft.Network/expressRouteCircuits/peerings@2022-07-01"
  parent_id = azapi_resource.expressRouteCircuit.id
  name      = "AzurePrivatePeering"
  body = {
    properties = {
      azureASN                   = 12076
      gatewayManagerEtag         = ""
      peerASN                    = 100
      peeringType                = "AzurePrivatePeering"
      primaryPeerAddressPrefix   = "192.168.1.0/30"
      secondaryPeerAddressPrefix = "192.168.2.0/30"
      sharedKey                  = var.shared_key
      state                      = "Enabled"
      vlanId                     = 100
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "expressRouteGateway" {
  type      = "Microsoft.Network/expressRouteGateways@2022-07-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      allowNonVirtualWanTraffic = false
      autoScaleConfiguration = {
        bounds = {
          min = 1
        }
      }
      virtualHub = {
        id = azapi_resource.virtualHub.id
      }
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "expressRouteConnection" {
  type      = "Microsoft.Network/expressRouteGateways/expressRouteConnections@2022-07-01"
  parent_id = azapi_resource.expressRouteGateway.id
  name      = var.resource_name
  body = {
    properties = {
      enableInternetSecurity = false
      expressRouteCircuitPeering = {
        id = azapi_resource.peering.id
      }
      expressRouteGatewayBypass = false
      routingConfiguration = {
      }
      routingWeight = 0
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}