Nätverk expressRouteGateways/expressRouteConnections 2018-12-01

Bicep-resursdefinition

Resurstypen expressRouteGateways/expressRouteConnections kan distribueras med åtgärder som mål:

En lista över ändrade egenskaper i varje API-version finns i ändringsloggen.

Användningsexempel

Bicep-exempel

Ett grundläggande exempel på hur du distribuerar Express Route Connection.

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

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

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

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

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: sharedKey
    state: 'Enabled'
    vlanId: 100
  }
}

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

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
    }
  }
}

Resursformat

Om du vill skapa en Microsoft.Network/expressRouteGateways/expressRouteConnections-resurs lägger du till följande Bicep i mallen.

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

Egenskapsvärden

Microsoft.Network/expressRouteGateways/expressRouteConnections

Namn Beskrivning Värde
Namn Resursnamnet sträng (krävs)
förälder I Bicep kan du ange den överordnade resursen för en underordnad resurs. Du behöver bara lägga till den här egenskapen när den underordnade resursen deklareras utanför den överordnade resursen.

Mer information finns i Underordnad resurs utanför den överordnade resursen.
Symboliskt namn för resurs av typen: expressRouteGateways
Egenskaper Egenskaper för underresursen ExpressRouteConnection. ExpressRouteConnectionProperties

ExpressRouteCircuitPeeringId

Namn Beskrivning Värde
Id ID:t för ExpressRoute-kretspeeringen. sträng

ExpressRouteConnectionProperties

Namn Beskrivning Värde
authorizationKey Auktoriseringsnyckel för att upprätta anslutningen. sträng
expressRouteCircuitPeering ExpressRoute-kretspeering. ExpressRouteCircuitPeeringId (krävs)
routingVikt Routningsvikten som är kopplad till anslutningen. Int

Resursdefinition för ARM-mall

Resurstypen expressRouteGateways/expressRouteConnections kan distribueras med åtgärder som mål:

Användningsexempel

Resursformat

Om du vill skapa en Microsoft.Network/expressRouteGateways/expressRouteConnections-resurs lägger du till följande JSON i mallen.

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

Egenskapsvärden

Microsoft.Network/expressRouteGateways/expressRouteConnections

Namn Beskrivning Värde
apiVersion API-versionen '2018-12-01'
Namn Resursnamnet sträng (krävs)
Egenskaper Egenskaper för underresursen ExpressRouteConnection. ExpressRouteConnectionProperties
typ Resurstypen "Microsoft.Network/expressRouteGateways/expressRouteConnections"

ExpressRouteCircuitPeeringId

Namn Beskrivning Värde
Id ID:t för ExpressRoute-kretspeeringen. sträng

ExpressRouteConnectionProperties

Namn Beskrivning Värde
authorizationKey Auktoriseringsnyckel för att upprätta anslutningen. sträng
expressRouteCircuitPeering ExpressRoute-kretspeering. ExpressRouteCircuitPeeringId (krävs)
routingVikt Routningsvikten som är kopplad till anslutningen. Int

Resursdefinition för Terraform (AzAPI-provider)

Resurstypen expressRouteGateways/expressRouteConnections kan distribueras med åtgärder som mål:

  • Resursgrupper För en lista över ändrade egenskaper i varje API-version, se ändringslogg.

Användningsexempel

Terraform-exempel

Ett grundläggande exempel på hur du distribuerar 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    = ["*"]
}

Resursformat

Om du vill skapa en Microsoft.Network/expressRouteGateways/expressRouteConnections-resurs lägger du till följande Terraform i mallen.

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

Egenskapsvärden

Microsoft.Network/expressRouteGateways/expressRouteConnections

Namn Beskrivning Värde
Namn Resursnamnet sträng (krävs)
föräldra_id ID för resursen som är överordnad för den här resursen. ID för resurs av typen: expressRouteGateways
Egenskaper Egenskaper för underresursen ExpressRouteConnection. ExpressRouteConnectionProperties
typ Resurstypen "Microsoft.Network/expressRouteGateways/expressRouteConnections@2018-12-01"

ExpressRouteCircuitPeeringId

Namn Beskrivning Värde
Id ID:t för ExpressRoute-kretspeeringen. sträng

ExpressRouteConnectionProperties

Namn Beskrivning Värde
authorizationKey Auktoriseringsnyckel för att upprätta anslutningen. sträng
expressRouteCircuitPeering ExpressRoute-kretspeering. ExpressRouteCircuitPeeringId (krävs)
routingVikt Routningsvikten som är kopplad till anslutningen. Int