Bicep 資源定義
privateDnsZones/TXT 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
使用範例
Bicep 範例
部署私人 DNS TXT 記錄的基本範例。
param location string = 'westeurope'
param resourceName string = 'acctest0001'
resource privateDnsZone 'Microsoft.Network/privateDnsZones@2018-09-01' = {
name: '${resourceName}.com'
location: 'global'
}
resource tXT 'Microsoft.Network/privateDnsZones/TXT@2018-09-01' = {
name: resourceName
parent: privateDnsZone
properties: {
metadata: {}
ttl: 300
txtRecords: [
{
value: [
'Quick brown fox'
]
}
{
value: [
'A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text.....'
'.A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text....'
'..A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......'
]
}
]
}
}
Azure 已驗證的模組
下列 Azure 驗證模組 可用來部署此資源類型。
若要建立 Microsoft.Network/privateDnsZones/TXT 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Network/privateDnsZones/TXT@2024-06-01' = {
parent: resourceSymbolicName
etag: 'string'
name: 'string'
properties: {
aaaaRecords: [
{
ipv6Address: 'string'
}
]
aRecords: [
{
ipv4Address: 'string'
}
]
cnameRecord: {
cname: 'string'
}
metadata: {
{customized property}: 'string'
}
mxRecords: [
{
exchange: 'string'
preference: int
}
]
ptrRecords: [
{
ptrdname: 'string'
}
]
soaRecord: {
email: 'string'
expireTime: int
host: 'string'
minimumTtl: int
refreshTime: int
retryTime: int
serialNumber: int
}
srvRecords: [
{
port: int
priority: int
target: 'string'
weight: int
}
]
ttl: int
txtRecords: [
{
value: [
'string'
]
}
]
}
}
屬性值
Microsoft.Network/privateDnsZones/TXT
AaaaRecord
| 名字 |
描述 |
價值 |
| ipv6 位址 |
此 AAAA 記錄的 IPv6 位址。 |
字串 |
阿
| 名字 |
描述 |
價值 |
| ipv4位址 |
此 A 記錄的 IPv4 位址。 |
字串 |
CnameRecord
| 名字 |
描述 |
價值 |
| cname (標準名稱) |
此 CNAME 記錄的正式名稱。 |
字串 |
MxRecord
| 名字 |
描述 |
價值 |
| 交換 |
此 MX 記錄之郵件主機的功能變數名稱。 |
字串 |
| 偏好 |
此 MX 記錄的喜好設定值。 |
整數 (int) |
PtrRecord
| 名字 |
描述 |
價值 |
| ptrdname |
此 PTR 記錄的 PTR 目標功能變數名稱。 |
字串 |
RecordSetProperties
SoaRecord
| 名字 |
描述 |
價值 |
| 電子郵件 |
此 SOA 記錄的電子郵件連絡人。 |
字串 |
| 過期時間 |
此 SOA 記錄的到期時間。 |
整數 (int) |
| 主持人 |
此 SOA 記錄之授權名稱伺服器的功能變數名稱。 |
字串 |
| 最小 Ttl |
此 SOA 記錄的最小值。 依照慣例,這會用來判斷負快取持續時間。 |
整數 (int) |
| 刷新時間 |
此 SOA 記錄的重新整理值。 |
整數 (int) |
| 重試時間 |
此 SOA 記錄的重試時間。 |
整數 (int) |
| 序列號 |
此 SOA 記錄的序號。 |
整數 (int) |
SrvRecord
| 名字 |
描述 |
價值 |
| 傳輸埠 |
此 SRV 記錄的埠值。 |
整數 (int) |
| 優先權 |
此 SRV 記錄的優先順序值。 |
整數 (int) |
| 目標 |
此 SRV 記錄的目標功能變數名稱。 |
字串 |
| 重量 |
此 SRV 記錄的權數值。 |
整數 (int) |
TxtRecord (英文)
| 名字 |
描述 |
價值 |
| 價值 |
此 TXT 記錄的文字值。 |
字串[] |
ARM 樣本資源定義
privateDnsZones/TXT 資源類型可以使用目標作業來部署:
使用範例
若要建立 Microsoft.Network/privateDnsZones/TXT 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Network/privateDnsZones/TXT",
"apiVersion": "2024-06-01",
"name": "string",
"etag": "string",
"properties": {
"aaaaRecords": [
{
"ipv6Address": "string"
}
],
"aRecords": [
{
"ipv4Address": "string"
}
],
"cnameRecord": {
"cname": "string"
},
"metadata": {
"{customized property}": "string"
},
"mxRecords": [
{
"exchange": "string",
"preference": "int"
}
],
"ptrRecords": [
{
"ptrdname": "string"
}
],
"soaRecord": {
"email": "string",
"expireTime": "int",
"host": "string",
"minimumTtl": "int",
"refreshTime": "int",
"retryTime": "int",
"serialNumber": "int"
},
"srvRecords": [
{
"port": "int",
"priority": "int",
"target": "string",
"weight": "int"
}
],
"ttl": "int",
"txtRecords": [
{
"value": [ "string" ]
}
]
}
}
屬性值
Microsoft.Network/privateDnsZones/TXT
| 名字 |
描述 |
價值 |
| apiVersion |
API 版本 |
'2024-06-01' |
| ETAG |
記錄集的 ETag。 |
字串 |
| 名字 |
資源名稱 |
字串 (必要) |
| 性能 |
記錄集的屬性。 |
RecordSetProperties |
| 型別 |
資源類型 |
“Microsoft.Network/privateDnsZones/TXT” |
AaaaRecord
| 名字 |
描述 |
價值 |
| ipv6 位址 |
此 AAAA 記錄的 IPv6 位址。 |
字串 |
阿
| 名字 |
描述 |
價值 |
| ipv4位址 |
此 A 記錄的 IPv4 位址。 |
字串 |
CnameRecord
| 名字 |
描述 |
價值 |
| cname (標準名稱) |
此 CNAME 記錄的正式名稱。 |
字串 |
MxRecord
| 名字 |
描述 |
價值 |
| 交換 |
此 MX 記錄之郵件主機的功能變數名稱。 |
字串 |
| 偏好 |
此 MX 記錄的喜好設定值。 |
整數 (int) |
PtrRecord
| 名字 |
描述 |
價值 |
| ptrdname |
此 PTR 記錄的 PTR 目標功能變數名稱。 |
字串 |
RecordSetProperties
SoaRecord
| 名字 |
描述 |
價值 |
| 電子郵件 |
此 SOA 記錄的電子郵件連絡人。 |
字串 |
| 過期時間 |
此 SOA 記錄的到期時間。 |
整數 (int) |
| 主持人 |
此 SOA 記錄之授權名稱伺服器的功能變數名稱。 |
字串 |
| 最小 Ttl |
此 SOA 記錄的最小值。 依照慣例,這會用來判斷負快取持續時間。 |
整數 (int) |
| 刷新時間 |
此 SOA 記錄的重新整理值。 |
整數 (int) |
| 重試時間 |
此 SOA 記錄的重試時間。 |
整數 (int) |
| 序列號 |
此 SOA 記錄的序號。 |
整數 (int) |
SrvRecord
| 名字 |
描述 |
價值 |
| 傳輸埠 |
此 SRV 記錄的埠值。 |
整數 (int) |
| 優先權 |
此 SRV 記錄的優先順序值。 |
整數 (int) |
| 目標 |
此 SRV 記錄的目標功能變數名稱。 |
字串 |
| 重量 |
此 SRV 記錄的權數值。 |
整數 (int) |
TxtRecord (英文)
| 名字 |
描述 |
價值 |
| 價值 |
此 TXT 記錄的文字值。 |
字串[] |
privateDnsZones/TXT 資源類型可以使用目標作業來部署:
-
資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。
使用範例
部署私人 DNS TXT 記錄的基本範例。
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" "privateDnsZone" {
type = "Microsoft.Network/privateDnsZones@2018-09-01"
parent_id = azapi_resource.resourceGroup.id
name = "${var.resource_name}.com"
location = "global"
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "TXT" {
type = "Microsoft.Network/privateDnsZones/TXT@2018-09-01"
parent_id = azapi_resource.privateDnsZone.id
name = var.resource_name
body = {
properties = {
metadata = {
}
ttl = 300
txtRecords = [
{
value = [
"Quick brown fox",
]
},
{
value = [
"A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text.....",
".A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text....",
"..A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......A long text......",
]
},
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
若要建立 Microsoft.Network/privateDnsZones/TXT 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Network/privateDnsZones/TXT@2024-06-01"
name = "string"
parent_id = "string"
body = {
etag = "string"
properties = {
aaaaRecords = [
{
ipv6Address = "string"
}
]
aRecords = [
{
ipv4Address = "string"
}
]
cnameRecord = {
cname = "string"
}
metadata = {
{customized property} = "string"
}
mxRecords = [
{
exchange = "string"
preference = int
}
]
ptrRecords = [
{
ptrdname = "string"
}
]
soaRecord = {
email = "string"
expireTime = int
host = "string"
minimumTtl = int
refreshTime = int
retryTime = int
serialNumber = int
}
srvRecords = [
{
port = int
priority = int
target = "string"
weight = int
}
]
ttl = int
txtRecords = [
{
value = [
"string"
]
}
]
}
}
}
屬性值
Microsoft.Network/privateDnsZones/TXT
| 名字 |
描述 |
價值 |
| ETAG |
記錄集的 ETag。 |
字串 |
| 名字 |
資源名稱 |
字串 (必要) |
| 父項識別碼 |
此資源為父系之資源的標識碼。 |
類型資源的標識碼:privateDnsZones |
| 性能 |
記錄集的屬性。 |
RecordSetProperties |
| 型別 |
資源類型 |
“Microsoft.Network/privateDnsZones/TXT@2024-06-01” |
AaaaRecord
| 名字 |
描述 |
價值 |
| ipv6 位址 |
此 AAAA 記錄的 IPv6 位址。 |
字串 |
阿
| 名字 |
描述 |
價值 |
| ipv4位址 |
此 A 記錄的 IPv4 位址。 |
字串 |
CnameRecord
| 名字 |
描述 |
價值 |
| cname (標準名稱) |
此 CNAME 記錄的正式名稱。 |
字串 |
MxRecord
| 名字 |
描述 |
價值 |
| 交換 |
此 MX 記錄之郵件主機的功能變數名稱。 |
字串 |
| 偏好 |
此 MX 記錄的喜好設定值。 |
整數 (int) |
PtrRecord
| 名字 |
描述 |
價值 |
| ptrdname |
此 PTR 記錄的 PTR 目標功能變數名稱。 |
字串 |
RecordSetProperties
SoaRecord
| 名字 |
描述 |
價值 |
| 電子郵件 |
此 SOA 記錄的電子郵件連絡人。 |
字串 |
| 過期時間 |
此 SOA 記錄的到期時間。 |
整數 (int) |
| 主持人 |
此 SOA 記錄之授權名稱伺服器的功能變數名稱。 |
字串 |
| 最小 Ttl |
此 SOA 記錄的最小值。 依照慣例,這會用來判斷負快取持續時間。 |
整數 (int) |
| 刷新時間 |
此 SOA 記錄的重新整理值。 |
整數 (int) |
| 重試時間 |
此 SOA 記錄的重試時間。 |
整數 (int) |
| 序列號 |
此 SOA 記錄的序號。 |
整數 (int) |
SrvRecord
| 名字 |
描述 |
價值 |
| 傳輸埠 |
此 SRV 記錄的埠值。 |
整數 (int) |
| 優先權 |
此 SRV 記錄的優先順序值。 |
整數 (int) |
| 目標 |
此 SRV 記錄的目標功能變數名稱。 |
字串 |
| 重量 |
此 SRV 記錄的權數值。 |
整數 (int) |
TxtRecord (英文)
| 名字 |
描述 |
價值 |
| 價值 |
此 TXT 記錄的文字值。 |
字串[] |