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

privatedns.tf#L11
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
}
dns.tf#L14
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
}
dns_zones.tf#L16
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
dns.tf#L14
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
}
ple_and_dns.tf#L99
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
}
120-DNS.tf#L7
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
}
vnet-dns.tf#L11
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
}
dns-zones.tf#L10
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
}
dns_zone.tf#L14
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
privatedns.tf#L11
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
}

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

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

Azure Private DNS Zone Virtual Network Link is a resource for Private DNS of Microsoft Azure. Settings can be wrote in Terraform.

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.