Microsoft.Network expressRouteCircuits/對等互連 2020-08-01

Bicep 資源定義

expressRouteCircuits/peerings 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

使用範例

Bicep 範例

部署 ExpressRoute 線路對等互連的基本範例。

param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The shared key for the Express Route circuit peering')
param expressRouteSharedKey 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
  sku: {
    family: 'MeteredData'
    name: 'Premium_MeteredData'
    tier: 'Premium'
  }
  properties: {
    authorizationKey: ''
    bandwidthInGbps: 5
    expressRoutePort: {
      id: expressRoutePort.id
    }
  }
}

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

Azure 快速入門範例

下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。

Bicep 檔案 描述
使用私人對等互連和 Azure VNet ExpressRoute 線路 此範本會設定 ExpressRoute Microsoft對等互連、部署具有 Expressroute 閘道的 Azure VNet,並將 VNet 連結到 ExpressRoute 線路

資源格式

若要建立 Microsoft.Network/expressRouteCircuits/peerings 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Network/expressRouteCircuits/peerings@2020-08-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    azureASN: int
    connections: [
      {
        id: 'string'
        name: 'string'
        properties: {
          addressPrefix: 'string'
          authorizationKey: 'string'
          expressRouteCircuitPeering: {
            id: 'string'
          }
          ipv6CircuitConnectionConfig: {
            addressPrefix: 'string'
          }
          peerExpressRouteCircuitPeering: {
            id: 'string'
          }
        }
      }
    ]
    expressRouteConnection: {}
    gatewayManagerEtag: 'string'
    ipv6PeeringConfig: {
      microsoftPeeringConfig: {
        advertisedCommunities: [
          'string'
        ]
        advertisedPublicPrefixes: [
          'string'
        ]
        customerASN: int
        legacyMode: int
        routingRegistryName: 'string'
      }
      primaryPeerAddressPrefix: 'string'
      routeFilter: {
        id: 'string'
      }
      secondaryPeerAddressPrefix: 'string'
      state: 'string'
    }
    microsoftPeeringConfig: {
      advertisedCommunities: [
        'string'
      ]
      advertisedPublicPrefixes: [
        'string'
      ]
      customerASN: int
      legacyMode: int
      routingRegistryName: 'string'
    }
    peerASN: int
    peeringType: 'string'
    primaryAzurePort: 'string'
    primaryPeerAddressPrefix: 'string'
    routeFilter: {
      id: 'string'
    }
    secondaryAzurePort: 'string'
    secondaryPeerAddressPrefix: 'string'
    sharedKey: 'string'
    state: 'string'
    stats: {
      primarybytesIn: int
      primarybytesOut: int
      secondarybytesIn: int
      secondarybytesOut: int
    }
    vlanId: int
  }
}

屬性值

Microsoft.Network/expressRouteCircuits/對等互連

名字 描述 價值
名字 資源名稱 字串 (必要)
父代 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源。
類型資源的符號名稱:expressRouteCircuits
性能 Express Route 線路對等互連的屬性。 ExpressRouteCircuitPeeringPropertiesFormat

ExpressRouteCircuitConnection

名字 描述 價值
識別碼 資源標識碼。 字串
名字 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 字串
性能 快速路由線路連線的屬性。 ExpressRouteCircuitConnectionPropertiesFormat

ExpressRouteCircuitConnectionPropertiesFormat

名字 描述 價值
addressPrefix 的 /29 IP 位址空間,以找出通道的客戶位址。 字串
authorizationKey 授權金鑰。 字串
expressRouteCircuit對等互連 起始連線之線路的 Express Route 線路私人對等互連資源的參考。 子資源
ipv6CircuitConnectionConfig Express Route 線路連線的 IPv6 位址 PrefixProperties。 Ipv6CircuitConnectionConfig
對等 ExpressRouteCircuit對等互連 對等互連線路的 Express Route 線路私人對等互連資源的參考。 子資源

ExpressRouteCircuitPeeringConfig

名字 描述 價值
公告社群 bgp 對等互連的社群。 針對 Microsoft 對等互連指定。 字串[]
advertisedPublicPrefixes AdvertisedPublicPrefixes 的參考。 字串[]
客戶ASN 對等互連的 CustomerASN。 整數 (int)
legacyMode 對等互連的舊版模式。 整數 (int)
routingRegistryName (路由註冊表名稱) 組態的 RoutingRegistryName。 字串

ExpressRouteCircuitPeeringPropertiesFormat

名字 描述 價值
azureASN Azure ASN。 整數 (int)
連接 此線路與 Azure 私人對等互連相關聯的線路連線清單。 ExpressRouteCircuitConnection[]
expressRouteConnection ExpressRoute 連線。 ExpressRouteConnectionId
gatewayManagerEtag GatewayManager Etag。 字串
ipv6對等配置 IPv6 對等互連設定。 IPv6ExpressRouteCircuitPeeringConfig
microsoftPeeringConfig Microsoft對等互連組態。 ExpressRouteCircuitPeeringConfig
對等 ASN 對等 ASN。 int

約束:
最小值 = 1
最大值 = 4294967295
對等類型 對等互連類型。 “AzurePrivatePeering”
“AzurePublicPeering”
“MicrosoftPeering”
primaryAzurePort 主要埠。 字串
primaryPeerAddressPrefix 主要位址前置詞。 字串
routeFilter RouteFilter 資源的參考。 子資源
輔助 AzurePort 次要埠。 字串
secondaryPeerAddressPrefix 次要位址前置詞。 字串
共享密鑰 共用金鑰。 字串
狀態 對等互連狀態。 “已禁用”
“已啟用”
統計 Express Route 線路的對等互連統計數據。 ExpressRouteCircuitStats
vlanId VLAN 識別碼。 整數 (int)

ExpressRouteCircuitStats

名字 描述 價值
primarybytesIn 對等互連的主要 BytesIn。 整數 (int)
primarybytesOut 對等互連的主要 BytesOut。 整數 (int)
secondarybytesIn 對等互連的次要 BytesIn。 整數 (int)
secondarybytesOut 對等互連的次要 BytesOut。 整數 (int)

ExpressRouteConnectionId

名字 描述 價值

Ipv6CircuitConnectionConfig

名字 描述 價值
addressPrefix 的 /125 IP 位址空間,以找出全球觸達的客戶位址。 字串

IPv6ExpressRouteCircuitPeeringConfig

名字 描述 價值
microsoftPeeringConfig Microsoft對等互連組態。 ExpressRouteCircuitPeeringConfig
primaryPeerAddressPrefix 主要位址前置詞。 字串
routeFilter RouteFilter 資源的參考。 子資源
secondaryPeerAddressPrefix 次要位址前置詞。 字串
狀態 對等互連的狀態。 “已禁用”
“已啟用”

子資源

名字 描述 價值
識別碼 資源標識碼。 字串

ARM 樣本資源定義

expressRouteCircuits/peerings 資源類型可以使用目標作業來部署:

使用範例

Azure 快速入門範本

下列 Azure 快速入門範本 部署此資源類型。

範本 描述
使用私人對等互連和 Azure VNet ExpressRoute 線路

部署至 Azure
此範本會設定 ExpressRoute Microsoft對等互連、部署具有 Expressroute 閘道的 Azure VNet,並將 VNet 連結到 ExpressRoute 線路

資源格式

若要建立 Microsoft.Network/expressRouteCircuits/peerings 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.Network/expressRouteCircuits/peerings",
  "apiVersion": "2020-08-01",
  "name": "string",
  "properties": {
    "azureASN": "int",
    "connections": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "addressPrefix": "string",
          "authorizationKey": "string",
          "expressRouteCircuitPeering": {
            "id": "string"
          },
          "ipv6CircuitConnectionConfig": {
            "addressPrefix": "string"
          },
          "peerExpressRouteCircuitPeering": {
            "id": "string"
          }
        }
      }
    ],
    "expressRouteConnection": {
    },
    "gatewayManagerEtag": "string",
    "ipv6PeeringConfig": {
      "microsoftPeeringConfig": {
        "advertisedCommunities": [ "string" ],
        "advertisedPublicPrefixes": [ "string" ],
        "customerASN": "int",
        "legacyMode": "int",
        "routingRegistryName": "string"
      },
      "primaryPeerAddressPrefix": "string",
      "routeFilter": {
        "id": "string"
      },
      "secondaryPeerAddressPrefix": "string",
      "state": "string"
    },
    "microsoftPeeringConfig": {
      "advertisedCommunities": [ "string" ],
      "advertisedPublicPrefixes": [ "string" ],
      "customerASN": "int",
      "legacyMode": "int",
      "routingRegistryName": "string"
    },
    "peerASN": "int",
    "peeringType": "string",
    "primaryAzurePort": "string",
    "primaryPeerAddressPrefix": "string",
    "routeFilter": {
      "id": "string"
    },
    "secondaryAzurePort": "string",
    "secondaryPeerAddressPrefix": "string",
    "sharedKey": "string",
    "state": "string",
    "stats": {
      "primarybytesIn": "int",
      "primarybytesOut": "int",
      "secondarybytesIn": "int",
      "secondarybytesOut": "int"
    },
    "vlanId": "int"
  }
}

屬性值

Microsoft.Network/expressRouteCircuits/對等互連

名字 描述 價值
apiVersion API 版本 '2020-08-01'
名字 資源名稱 字串 (必要)
性能 Express Route 線路對等互連的屬性。 ExpressRouteCircuitPeeringPropertiesFormat
型別 資源類型 “Microsoft.Network/expressRouteCircuits/peerings”

ExpressRouteCircuitConnection

名字 描述 價值
識別碼 資源標識碼。 字串
名字 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 字串
性能 快速路由線路連線的屬性。 ExpressRouteCircuitConnectionPropertiesFormat

ExpressRouteCircuitConnectionPropertiesFormat

名字 描述 價值
addressPrefix 的 /29 IP 位址空間,以找出通道的客戶位址。 字串
authorizationKey 授權金鑰。 字串
expressRouteCircuit對等互連 起始連線之線路的 Express Route 線路私人對等互連資源的參考。 子資源
ipv6CircuitConnectionConfig Express Route 線路連線的 IPv6 位址 PrefixProperties。 Ipv6CircuitConnectionConfig
對等 ExpressRouteCircuit對等互連 對等互連線路的 Express Route 線路私人對等互連資源的參考。 子資源

ExpressRouteCircuitPeeringConfig

名字 描述 價值
公告社群 bgp 對等互連的社群。 針對 Microsoft 對等互連指定。 字串[]
advertisedPublicPrefixes AdvertisedPublicPrefixes 的參考。 字串[]
客戶ASN 對等互連的 CustomerASN。 整數 (int)
legacyMode 對等互連的舊版模式。 整數 (int)
routingRegistryName (路由註冊表名稱) 組態的 RoutingRegistryName。 字串

ExpressRouteCircuitPeeringPropertiesFormat

名字 描述 價值
azureASN Azure ASN。 整數 (int)
連接 此線路與 Azure 私人對等互連相關聯的線路連線清單。 ExpressRouteCircuitConnection[]
expressRouteConnection ExpressRoute 連線。 ExpressRouteConnectionId
gatewayManagerEtag GatewayManager Etag。 字串
ipv6對等配置 IPv6 對等互連設定。 IPv6ExpressRouteCircuitPeeringConfig
microsoftPeeringConfig Microsoft對等互連組態。 ExpressRouteCircuitPeeringConfig
對等 ASN 對等 ASN。 int

約束:
最小值 = 1
最大值 = 4294967295
對等類型 對等互連類型。 “AzurePrivatePeering”
“AzurePublicPeering”
“MicrosoftPeering”
primaryAzurePort 主要埠。 字串
primaryPeerAddressPrefix 主要位址前置詞。 字串
routeFilter RouteFilter 資源的參考。 子資源
輔助 AzurePort 次要埠。 字串
secondaryPeerAddressPrefix 次要位址前置詞。 字串
共享密鑰 共用金鑰。 字串
狀態 對等互連狀態。 “已禁用”
“已啟用”
統計 Express Route 線路的對等互連統計數據。 ExpressRouteCircuitStats
vlanId VLAN 識別碼。 整數 (int)

ExpressRouteCircuitStats

名字 描述 價值
primarybytesIn 對等互連的主要 BytesIn。 整數 (int)
primarybytesOut 對等互連的主要 BytesOut。 整數 (int)
secondarybytesIn 對等互連的次要 BytesIn。 整數 (int)
secondarybytesOut 對等互連的次要 BytesOut。 整數 (int)

ExpressRouteConnectionId

名字 描述 價值

Ipv6CircuitConnectionConfig

名字 描述 價值
addressPrefix 的 /125 IP 位址空間,以找出全球觸達的客戶位址。 字串

IPv6ExpressRouteCircuitPeeringConfig

名字 描述 價值
microsoftPeeringConfig Microsoft對等互連組態。 ExpressRouteCircuitPeeringConfig
primaryPeerAddressPrefix 主要位址前置詞。 字串
routeFilter RouteFilter 資源的參考。 子資源
secondaryPeerAddressPrefix 次要位址前置詞。 字串
狀態 對等互連的狀態。 “已禁用”
“已啟用”

子資源

名字 描述 價值
識別碼 資源標識碼。 字串

Terraform (AzAPI 提供者) 資源定義

expressRouteCircuits/peerings 資源類型可以使用目標作業來部署:

  • 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

使用範例

Terraform 範例

部署 ExpressRoute 線路對等互連的基本範例。

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 "express_route_shared_key" {
  type        = string
  description = "The shared key for the Express Route circuit peering"
  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" "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.express_route_shared_key
      state                      = "Enabled"
      vlanId                     = 100
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

資源格式

若要建立 Microsoft.Network/expressRouteCircuits/peerings 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Network/expressRouteCircuits/peerings@2020-08-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      azureASN = int
      connections = [
        {
          id = "string"
          name = "string"
          properties = {
            addressPrefix = "string"
            authorizationKey = "string"
            expressRouteCircuitPeering = {
              id = "string"
            }
            ipv6CircuitConnectionConfig = {
              addressPrefix = "string"
            }
            peerExpressRouteCircuitPeering = {
              id = "string"
            }
          }
        }
      ]
      expressRouteConnection = {
      }
      gatewayManagerEtag = "string"
      ipv6PeeringConfig = {
        microsoftPeeringConfig = {
          advertisedCommunities = [
            "string"
          ]
          advertisedPublicPrefixes = [
            "string"
          ]
          customerASN = int
          legacyMode = int
          routingRegistryName = "string"
        }
        primaryPeerAddressPrefix = "string"
        routeFilter = {
          id = "string"
        }
        secondaryPeerAddressPrefix = "string"
        state = "string"
      }
      microsoftPeeringConfig = {
        advertisedCommunities = [
          "string"
        ]
        advertisedPublicPrefixes = [
          "string"
        ]
        customerASN = int
        legacyMode = int
        routingRegistryName = "string"
      }
      peerASN = int
      peeringType = "string"
      primaryAzurePort = "string"
      primaryPeerAddressPrefix = "string"
      routeFilter = {
        id = "string"
      }
      secondaryAzurePort = "string"
      secondaryPeerAddressPrefix = "string"
      sharedKey = "string"
      state = "string"
      stats = {
        primarybytesIn = int
        primarybytesOut = int
        secondarybytesIn = int
        secondarybytesOut = int
      }
      vlanId = int
    }
  }
}

屬性值

Microsoft.Network/expressRouteCircuits/對等互連

名字 描述 價值
名字 資源名稱 字串 (必要)
父項識別碼 此資源為父系之資源的標識碼。 類型資源的標識碼:expressRouteCircuits
性能 Express Route 線路對等互連的屬性。 ExpressRouteCircuitPeeringPropertiesFormat
型別 資源類型 “Microsoft.Network/expressRouteCircuits/peerings@2020-08-01”

ExpressRouteCircuitConnection

名字 描述 價值
識別碼 資源標識碼。 字串
名字 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 字串
性能 快速路由線路連線的屬性。 ExpressRouteCircuitConnectionPropertiesFormat

ExpressRouteCircuitConnectionPropertiesFormat

名字 描述 價值
addressPrefix 的 /29 IP 位址空間,以找出通道的客戶位址。 字串
authorizationKey 授權金鑰。 字串
expressRouteCircuit對等互連 起始連線之線路的 Express Route 線路私人對等互連資源的參考。 子資源
ipv6CircuitConnectionConfig Express Route 線路連線的 IPv6 位址 PrefixProperties。 Ipv6CircuitConnectionConfig
對等 ExpressRouteCircuit對等互連 對等互連線路的 Express Route 線路私人對等互連資源的參考。 子資源

ExpressRouteCircuitPeeringConfig

名字 描述 價值
公告社群 bgp 對等互連的社群。 針對 Microsoft 對等互連指定。 字串[]
advertisedPublicPrefixes AdvertisedPublicPrefixes 的參考。 字串[]
客戶ASN 對等互連的 CustomerASN。 整數 (int)
legacyMode 對等互連的舊版模式。 整數 (int)
routingRegistryName (路由註冊表名稱) 組態的 RoutingRegistryName。 字串

ExpressRouteCircuitPeeringPropertiesFormat

名字 描述 價值
azureASN Azure ASN。 整數 (int)
連接 此線路與 Azure 私人對等互連相關聯的線路連線清單。 ExpressRouteCircuitConnection[]
expressRouteConnection ExpressRoute 連線。 ExpressRouteConnectionId
gatewayManagerEtag GatewayManager Etag。 字串
ipv6對等配置 IPv6 對等互連設定。 IPv6ExpressRouteCircuitPeeringConfig
microsoftPeeringConfig Microsoft對等互連組態。 ExpressRouteCircuitPeeringConfig
對等 ASN 對等 ASN。 int

約束:
最小值 = 1
最大值 = 4294967295
對等類型 對等互連類型。 “AzurePrivatePeering”
“AzurePublicPeering”
“MicrosoftPeering”
primaryAzurePort 主要埠。 字串
primaryPeerAddressPrefix 主要位址前置詞。 字串
routeFilter RouteFilter 資源的參考。 子資源
輔助 AzurePort 次要埠。 字串
secondaryPeerAddressPrefix 次要位址前置詞。 字串
共享密鑰 共用金鑰。 字串
狀態 對等互連狀態。 “已禁用”
“已啟用”
統計 Express Route 線路的對等互連統計數據。 ExpressRouteCircuitStats
vlanId VLAN 識別碼。 整數 (int)

ExpressRouteCircuitStats

名字 描述 價值
primarybytesIn 對等互連的主要 BytesIn。 整數 (int)
primarybytesOut 對等互連的主要 BytesOut。 整數 (int)
secondarybytesIn 對等互連的次要 BytesIn。 整數 (int)
secondarybytesOut 對等互連的次要 BytesOut。 整數 (int)

ExpressRouteConnectionId

名字 描述 價值

Ipv6CircuitConnectionConfig

名字 描述 價值
addressPrefix 的 /125 IP 位址空間,以找出全球觸達的客戶位址。 字串

IPv6ExpressRouteCircuitPeeringConfig

名字 描述 價值
microsoftPeeringConfig Microsoft對等互連組態。 ExpressRouteCircuitPeeringConfig
primaryPeerAddressPrefix 主要位址前置詞。 字串
routeFilter RouteFilter 資源的參考。 子資源
secondaryPeerAddressPrefix 次要位址前置詞。 字串
狀態 對等互連的狀態。 “已禁用”
“已啟用”

子資源

名字 描述 價值
識別碼 資源標識碼。 字串