Bicep 資源定義
virtualHubs/routingIntent 資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
使用範例
Azure 已驗證的模組
下列 Azure 驗證模組 可用來部署此資源類型。
| Module | 說明 |
|---|---|
| 虛擬集線器 - 路由意圖 | 虛擬樞紐的 AVM 子模組 - 路由意圖 |
資源格式
若要建立 Microsoft.Network/virtualHubs/routingIntent 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Network/virtualHubs/routingIntent@2024-07-01' = {
parent: resourceSymbolicName
name: 'string'
properties: {
routingPolicies: [
{
destinations: [
'string'
]
name: 'string'
nextHop: 'string'
}
]
}
}
屬性值
Microsoft.Network/virtualHubs/routingIntent
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| 名稱 | 資源名稱 | 字串 (必要) |
| 父代 | 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。 如需詳細資訊,請參閱 父資源外部的子資源。 |
類型資源的符號名稱:virtualHubs |
| 屬性 | RoutingIntent 資源的屬性。 | RoutingIntentProperties |
RoutingIntentProperties
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| routingPolicies | 路由原則清單。 | 路由策略 |
路由策略
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| 目的地 | 此路由原則適用的所有目的地清單(例如:因特網、PrivateTraffic)。 | string[] (必要) |
| 名稱 | 路由原則的唯一名稱。 | 字串 (必要) |
| nextHop | 此路由原則適用的下一個躍點資源標識符。 | 字串 (必要) |
ARM 樣本資源定義
virtualHubs/routingIntent 資源類型可以使用目標作業來部署:
使用範例
資源格式
若要建立 Microsoft.Network/virtualHubs/routingIntent 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Network/virtualHubs/routingIntent",
"apiVersion": "2024-07-01",
"name": "string",
"properties": {
"routingPolicies": [
{
"destinations": [ "string" ],
"name": "string",
"nextHop": "string"
}
]
}
}
屬性值
Microsoft.Network/virtualHubs/routingIntent
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| apiVersion | API 版本 | '2024-07-01' |
| 名稱 | 資源名稱 | 字串 (必要) |
| 屬性 | RoutingIntent 資源的屬性。 | RoutingIntentProperties |
| 型別 | 資源類型 | “Microsoft.Network/virtualHubs/routingIntent” |
RoutingIntentProperties
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| routingPolicies | 路由原則清單。 | 路由策略 |
路由策略
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| 目的地 | 此路由原則適用的所有目的地清單(例如:因特網、PrivateTraffic)。 | string[] (必要) |
| 名稱 | 路由原則的唯一名稱。 | 字串 (必要) |
| nextHop | 此路由原則適用的下一個躍點資源標識符。 | 字串 (必要) |
Terraform (AzAPI 提供者) 資源定義
virtualHubs/routingIntent 資源類型可以使用目標作業來部署:
- 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。
使用範例
Terraform 範例
部署虛擬中樞路由意圖的基本範例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azurerm" {
features {
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
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.2.0/24"
hubRoutingPreference = "ExpressRoute"
virtualRouterAutoScaleConfiguration = {
minCapacity = 2
}
virtualWan = {
id = azapi_resource.virtualWan.id
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azurerm_firewall" "test" {
name = var.resource_name
location = azapi_resource.resourceGroup.location
resource_group_name = azapi_resource.resourceGroup.name
sku_name = "AZFW_Hub"
sku_tier = "Standard"
virtual_hub {
virtual_hub_id = azapi_resource.virtualHub.id
public_ip_count = 1
}
}
resource "azapi_resource" "routingIntent" {
name = var.resource_name
type = "Microsoft.Network/virtualHubs/routingIntent@2022-09-01"
parent_id = azapi_resource.virtualHub.id
body = {
properties = {
routingPolicies = [
{
name = "InternetTraffic"
destinations = [
"Internet"
]
nextHop = azurerm_firewall.test.id
},
{
name = "PrivateTrafficPolicy"
destinations = [
"PrivateTraffic"
]
nextHop = azurerm_firewall.test.id
}
]
}
}
}
資源格式
若要建立 Microsoft.Network/virtualHubs/routingIntent 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Network/virtualHubs/routingIntent@2024-07-01"
name = "string"
parent_id = "string"
body = {
properties = {
routingPolicies = [
{
destinations = [
"string"
]
name = "string"
nextHop = "string"
}
]
}
}
}
屬性值
Microsoft.Network/virtualHubs/routingIntent
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| 名稱 | 資源名稱 | 字串 (必要) |
| parent_id | 此資源為父系之資源的標識碼。 | 類型資源的標識碼:virtualHubs |
| 屬性 | RoutingIntent 資源的屬性。 | RoutingIntentProperties |
| 型別 | 資源類型 | “Microsoft.Network/virtualHubs/routingIntent@2024-07-01” |
RoutingIntentProperties
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| routingPolicies | 路由原則清單。 | 路由策略 |
路由策略
| 名稱 | 說明 | 價值觀 |
|---|---|---|
| 目的地 | 此路由原則適用的所有目的地清單(例如:因特網、PrivateTraffic)。 | string[] (必要) |
| 名稱 | 路由原則的唯一名稱。 | 字串 (必要) |
| nextHop | 此路由原則適用的下一個躍點資源標識符。 | 字串 (必要) |