Bicep 資源定義
routeFilters 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
使用範例
Bicep 範例
部署路由過濾器的基本範例。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource routeFilter 'Microsoft.Network/routeFilters@2022-09-01' = {
name: resourceName
location: location
properties: {
rules: []
}
}
若要建立 Microsoft.Network/routeFilters 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Network/routeFilters@2021-08-01' = {
location: 'string'
name: 'string'
properties: {
rules: [
{
id: 'string'
location: 'string'
name: 'string'
properties: {
access: 'string'
communities: [
'string'
]
routeFilterRuleType: 'string'
}
}
]
}
tags: {
{customized property}: 'string'
}
}
屬性值
Microsoft.Network/routeFilters
路由過濾器規則
| 名字 |
描述 |
價值 |
| 訪問 |
規則的存取類型。 |
'允許' '拒絕' (必要) |
| 社區 |
要篩選之 bgp 社群值的集合。例如 ['12076:5010','12076:5020']。 |
string[] (必要) |
| routeFilterRuleType |
規則的規則類型。 |
'Community' (必要) |
ARM 樣本資源定義
routeFilters 資源類型可以使用目標作業來部署:
使用範例
若要建立 Microsoft.Network/routeFilters 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Network/routeFilters",
"apiVersion": "2021-08-01",
"name": "string",
"location": "string",
"properties": {
"rules": [
{
"id": "string",
"location": "string",
"name": "string",
"properties": {
"access": "string",
"communities": [ "string" ],
"routeFilterRuleType": "string"
}
}
]
},
"tags": {
"{customized property}": "string"
}
}
屬性值
Microsoft.Network/routeFilters
| 名字 |
描述 |
價值 |
| apiVersion |
API 版本 |
'2021-08-01' |
| 位置 |
資源位置。 |
字串 |
| 名字 |
資源名稱 |
字串 (必要) |
| 性能 |
路由篩選的屬性。 |
RouteFilterPropertiesFormat |
| 標籤 |
資源標籤 |
標記名稱和值的字典。 請參閱範本中的 標籤 |
| 型別 |
資源類型 |
“Microsoft.Network/routeFilters” |
路由過濾器規則
| 名字 |
描述 |
價值 |
| 訪問 |
規則的存取類型。 |
'允許' '拒絕' (必要) |
| 社區 |
要篩選之 bgp 社群值的集合。例如 ['12076:5010','12076:5020']。 |
string[] (必要) |
| routeFilterRuleType |
規則的規則類型。 |
'Community' (必要) |
routeFilters 資源類型可以使用目標作業來部署:
-
資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。
使用範例
部署路由過濾器的基本範例。
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"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "routeFilter" {
type = "Microsoft.Network/routeFilters@2022-09-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
rules = [
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
若要建立 Microsoft.Network/routeFilters 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Network/routeFilters@2021-08-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
rules = [
{
id = "string"
location = "string"
name = "string"
properties = {
access = "string"
communities = [
"string"
]
routeFilterRuleType = "string"
}
}
]
}
}
}
屬性值
Microsoft.Network/routeFilters
| 名字 |
描述 |
價值 |
| 位置 |
資源位置。 |
字串 |
| 名字 |
資源名稱 |
字串 (必要) |
| 性能 |
路由篩選的屬性。 |
RouteFilterPropertiesFormat |
| 標籤 |
資源標籤 |
標記名稱和值的字典。 |
| 型別 |
資源類型 |
“Microsoft.Network/routeFilters@2021-08-01” |
路由過濾器規則
| 名字 |
描述 |
價值 |
| 訪問 |
規則的存取類型。 |
'允許' '拒絕' (必要) |
| 社區 |
要篩選之 bgp 社群值的集合。例如 ['12076:5010','12076:5020']。 |
string[] (必要) |
| routeFilterRuleType |
規則的規則類型。 |
'Community' (必要) |