Bicep 资源定义
可以使用目标操作部署 expressRouteCircuits/peerings/connections 资源类型:
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
用法示例
Bicep 示例
部署 Express Route 线路连接的基本示例。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The shared key for the Express Route circuit peering connections')
param expressRouteConnectionSharedKey string
resource expressRoutePort 'Microsoft.Network/ExpressRoutePorts@2022-07-01' = {
name: resourceName
location: location
properties: {
bandwidthInGbps: 10
encapsulation: 'Dot1Q'
peeringLocation: 'Airtel-Chennai2-CLS'
}
}
resource expressRoutePort2 '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: 'Standard_MeteredData'
tier: 'Standard'
}
properties: {
authorizationKey: ''
bandwidthInGbps: 5
expressRoutePort: {
id: expressRoutePort.id
}
}
}
resource expressRouteCircuit2 'Microsoft.Network/expressRouteCircuits@2022-07-01' = {
name: resourceName
location: location
sku: {
family: 'MeteredData'
name: 'Standard_MeteredData'
tier: 'Standard'
}
properties: {
authorizationKey: ''
bandwidthInGbps: 5
expressRoutePort: {
id: expressRoutePort2.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.1.0/30'
sharedKey: expressRouteConnectionSharedKey
state: 'Enabled'
vlanId: 100
}
}
resource peering2 'Microsoft.Network/expressRouteCircuits/peerings@2022-07-01' = {
name: 'AzurePrivatePeering'
parent: expressRouteCircuit2
properties: {
azureASN: 12076
gatewayManagerEtag: ''
peerASN: 100
peeringType: 'AzurePrivatePeering'
primaryPeerAddressPrefix: '192.168.1.0/30'
secondaryPeerAddressPrefix: '192.168.1.0/30'
sharedKey: expressRouteConnectionSharedKey
state: 'Enabled'
vlanId: 100
}
}
resource connection 'Microsoft.Network/expressRouteCircuits/peerings/connections@2022-07-01' = {
name: resourceName
parent: peering
properties: {
addressPrefix: '192.169.8.0/29'
expressRouteCircuitPeering: {
id: peering.id
}
peerExpressRouteCircuitPeering: {
id: peering2.id
}
}
}
若要创建 Microsoft.Network/expressRouteCircuits/peerings/connections 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.Network/expressRouteCircuits/peerings/connections@2020-08-01' = {
parent: resourceSymbolicName
name: 'string'
properties: {
addressPrefix: 'string'
authorizationKey: 'string'
expressRouteCircuitPeering: {
id: 'string'
}
ipv6CircuitConnectionConfig: {
addressPrefix: 'string'
}
peerExpressRouteCircuitPeering: {
id: 'string'
}
}
}
属性值
Microsoft.Network/expressRouteCircuits/对等互连/连接
| 名字 |
描述 |
价值 |
| addressPrefix 的 |
/29 IP 地址空间来挖掘隧道的客户地址。 |
字符串 |
| authorizationKey |
授权密钥。 |
字符串 |
| expressRouteCircuit对等互连 |
对线路发起连接的 Express Route 线路专用对等互连资源的引用。 |
子资源 |
| ipv6CircuitConnectionConfig |
快速路由线路连接的 IPv6 地址 PrefixProperties。 |
Ipv6CircuitConnectionConfig |
| 对等 ExpressRouteCircuit对等互连 |
对对等线路的 Express Route 线路专用对等互连资源的引用。 |
子资源 |
Ipv6CircuitConnectionConfig
| 名字 |
描述 |
价值 |
| addressPrefix 的 |
/125 IP 地址空间,以便为全球范围分配客户地址。 |
字符串 |
子资源
ARM 模板资源定义
可以使用目标操作部署 expressRouteCircuits/peerings/connections 资源类型:
用法示例
若要创建 Microsoft.Network/expressRouteCircuits/peerings/connections 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.Network/expressRouteCircuits/peerings/connections",
"apiVersion": "2020-08-01",
"name": "string",
"properties": {
"addressPrefix": "string",
"authorizationKey": "string",
"expressRouteCircuitPeering": {
"id": "string"
},
"ipv6CircuitConnectionConfig": {
"addressPrefix": "string"
},
"peerExpressRouteCircuitPeering": {
"id": "string"
}
}
}
属性值
Microsoft.Network/expressRouteCircuits/对等互连/连接
| 名字 |
描述 |
价值 |
| addressPrefix 的 |
/29 IP 地址空间来挖掘隧道的客户地址。 |
字符串 |
| authorizationKey |
授权密钥。 |
字符串 |
| expressRouteCircuit对等互连 |
对线路发起连接的 Express Route 线路专用对等互连资源的引用。 |
子资源 |
| ipv6CircuitConnectionConfig |
快速路由线路连接的 IPv6 地址 PrefixProperties。 |
Ipv6CircuitConnectionConfig |
| 对等 ExpressRouteCircuit对等互连 |
对对等线路的 Express Route 线路专用对等互连资源的引用。 |
子资源 |
Ipv6CircuitConnectionConfig
| 名字 |
描述 |
价值 |
| addressPrefix 的 |
/125 IP 地址空间,以便为全球范围分配客户地址。 |
字符串 |
子资源
可以使用目标操作部署 expressRouteCircuits/peerings/connections 资源类型:
-
资源组 关于每个API版本中变更属性的列表,请参见 更改日志。
用法示例
部署 Express Route 线路连接的基本示例。
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_connection_shared_key" {
type = string
description = "The shared key for the Express Route circuit peering connections"
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 = "Airtel-Chennai2-CLS"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "ExpressRoutePort2" {
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 = "Standard_MeteredData"
tier = "Standard"
}
}
ignore_casing = true
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "expressRouteCircuit2" {
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.ExpressRoutePort2.id
}
}
sku = {
family = "MeteredData"
name = "Standard_MeteredData"
tier = "Standard"
}
}
ignore_casing = true
schema_validation_enabled = false
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.1.0/30"
sharedKey = var.express_route_connection_shared_key
state = "Enabled"
vlanId = 100
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "peering2" {
type = "Microsoft.Network/expressRouteCircuits/peerings@2022-07-01"
parent_id = azapi_resource.expressRouteCircuit2.id
name = "AzurePrivatePeering"
body = {
properties = {
azureASN = 12076
gatewayManagerEtag = ""
peerASN = 100
peeringType = "AzurePrivatePeering"
primaryPeerAddressPrefix = "192.168.1.0/30"
secondaryPeerAddressPrefix = "192.168.1.0/30"
sharedKey = var.express_route_connection_shared_key
state = "Enabled"
vlanId = 100
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "connection" {
type = "Microsoft.Network/expressRouteCircuits/peerings/connections@2022-07-01"
parent_id = azapi_resource.peering.id
name = var.resource_name
body = {
properties = {
addressPrefix = "192.169.8.0/29"
expressRouteCircuitPeering = {
id = azapi_resource.peering.id
}
peerExpressRouteCircuitPeering = {
id = azapi_resource.peering2.id
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
若要创建 Microsoft.Network/expressRouteCircuits/peerings/connections 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Network/expressRouteCircuits/peerings/connections@2020-08-01"
name = "string"
parent_id = "string"
body = {
properties = {
addressPrefix = "string"
authorizationKey = "string"
expressRouteCircuitPeering = {
id = "string"
}
ipv6CircuitConnectionConfig = {
addressPrefix = "string"
}
peerExpressRouteCircuitPeering = {
id = "string"
}
}
}
}
属性值
Microsoft.Network/expressRouteCircuits/对等互连/连接
| 名字 |
描述 |
价值 |
| addressPrefix 的 |
/29 IP 地址空间来挖掘隧道的客户地址。 |
字符串 |
| authorizationKey |
授权密钥。 |
字符串 |
| expressRouteCircuit对等互连 |
对线路发起连接的 Express Route 线路专用对等互连资源的引用。 |
子资源 |
| ipv6CircuitConnectionConfig |
快速路由线路连接的 IPv6 地址 PrefixProperties。 |
Ipv6CircuitConnectionConfig |
| 对等 ExpressRouteCircuit对等互连 |
对对等线路的 Express Route 线路专用对等互连资源的引用。 |
子资源 |
Ipv6CircuitConnectionConfig
| 名字 |
描述 |
价值 |
| addressPrefix 的 |
/125 IP 地址空间,以便为全球范围分配客户地址。 |
字符串 |
子资源