Azure Private DNS Zone Virtual Network Link
This page shows how to write Terraform and Azure Resource Manager for Private DNS Zone Virtual Network Link and write them securely.
azurerm_private_dns_zone_virtual_network_link (Terraform)
The Zone Virtual Network Link in Private DNS can be configured in Terraform with the resource name azurerm_private_dns_zone_virtual_network_link. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_private_dns_zone_virtual_network_link" "hub" {
name = local.acr_dns_link_hub
resource_group_name = azurerm_resource_group.spoke.name
private_dns_zone_name = azurerm_private_dns_zone.acr.name
virtual_network_id = azurerm_virtual_network.hub.id
}
resource "azurerm_private_dns_zone_virtual_network_link" "vnet-hub-privatelink-azurewebsites-net-dnszone-virtuallink" {
name = "vnet-hub-privatelink-azurewebsites-net-dnszone-virtuallink"
resource_group_name = azurerm_resource_group.netops-prd-dns.name
private_dns_zone_name = azurerm_private_dns_zone.privatelink-azurewebsites-net.name
virtual_network_id = azurerm_virtual_network.vnet-hub.id
}
resource "azurerm_private_dns_zone_virtual_network_link" "azure_monitor" {
name = "azure-monitor-link"
resource_group_name = var.resource_group_name
virtual_network_id = azurerm_virtual_network.core.id
private_dns_zone_name = azurerm_private_dns_zone.azure_monitor.name
registration_enabled = false
resource "azurerm_private_dns_zone_virtual_network_link" "vnet-hub-privatelink-azurewebsites-net-dnszone-virtuallink" {
name = "vnet-hub-privatelink-azurewebsites-net-dnszone-virtuallink"
resource_group_name = azurerm_resource_group.netops-prd-dns.name
private_dns_zone_name = azurerm_private_dns_zone.privatelink-azurewebsites-net.name
virtual_network_id = azurerm_virtual_network.vnet-hub.id
}
resource "azurerm_private_dns_zone_virtual_network_link" "monitor-net" {
name = "pl-monitor-net"
resource_group_name = var.rg.name
private_dns_zone_name = azurerm_private_dns_zone.monitor.name
virtual_network_id = var.vnet.id
}
resource "azurerm_private_dns_zone_virtual_network_link" "vnet1" {
name = "vnet1link"
resource_group_name = var.infrastructure-rg
private_dns_zone_name = azurerm_private_dns_zone.dnsdse.name
virtual_network_id = azurerm_virtual_network.vnet1.id
}
resource "azurerm_private_dns_zone_virtual_network_link" "private-storage-blob" {
name = azurerm_private_dns_zone.private-storage-blob.name
resource_group_name = azurerm_resource_group.tf-connectivity.name
private_dns_zone_name = azurerm_private_dns_zone.private-storage-blob.name
virtual_network_id = azurerm_virtual_network.sandbox.id
}
resource "azurerm_private_dns_zone_virtual_network_link" "lz_acr" {
name = "lz_to_acrs"
resource_group_name = azurerm_resource_group.net-rg.name
private_dns_zone_name = azurerm_private_dns_zone.acr-dns.name
virtual_network_id = azurerm_virtual_network.vnet.id
}
resource "azurerm_private_dns_zone_virtual_network_link" "dns-vnet-link-svc" {
name = var.dns_vnet_link_name
resource_group_name = azurerm_resource_group.rg.name
private_dns_zone_name = azurerm_private_dns_zone.svc-local.name
virtual_network_id = azurerm_virtual_network.vnet.id
registration_enabled = true
resource "azurerm_private_dns_zone_virtual_network_link" "hub" {
name = local.acr_dns_link_hub
resource_group_name = azurerm_resource_group.spoke.name
private_dns_zone_name = azurerm_private_dns_zone.acr.name
virtual_network_id = azurerm_virtual_network.hub.id
}
Parameters
-
idoptional computed - string -
namerequired - string -
private_dns_zone_namerequired - string -
registration_enabledoptional - bool -
resource_group_namerequired - string -
tagsoptional - map from string to string -
virtual_network_idrequired - string -
timeoutssingle block
Explanation in Terraform Registry
Enables you to manage Private DNS zone Virtual Network Links. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS.
Microsoft.Network/privateDnsZones/virtualNetworkLinks (Azure Resource Manager)
The privateDnsZones/virtualNetworkLinks in Microsoft.Network can be configured in Azure Resource Manager with the resource name Microsoft.Network/privateDnsZones/virtualNetworkLinks. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Frequently asked questions
What is Azure Private DNS Zone Virtual Network Link?
Azure Private DNS Zone Virtual Network Link is a resource for Private DNS of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Private DNS Zone Virtual Network Link?
For Terraform, the fortunkam/aks-secure-baseline, konradmaleckipl/Terraform-workshop and microsoft/AzureTRE source code examples are useful. See the Terraform Example section for further details.