This module deploys all known Azure Private DNS Zones for Azure Services that support Private Link as documented and detailed here in Azure Private Endpoint private DNS zone values.
The module also has logic built in to it to handle the replacements of the following strings in the Private DNS Zone Names to the appropriate Azure Region name, short name or geo-code as required:
...{regionName}...
...{regionCode}...
Note
This module only supports Azure Public/Commercial today and NOT Azure US Government Cloud (a.k.a. Fairfax) or Azure China Cloud (a.k.a. Mooncake). If you would like to see support added for these clouds please raise an issue/feature request on this repo/module.
Important
As the overall AVM framework is not GA (generally available) yet - the CI framework and test automation is not fully functional and implemented across all supported languages yet - breaking changes are expected, and additional customer feedback is yet to be gathered and incorporated. Hence, modules MUST NOT be published at version 1.0.0
or higher at this time.
All module MUST be published as a pre-release version (e.g., 0.1.0
, 0.1.1
, 0.2.0
, etc.) until the AVM framework becomes GA.
However, it is important to note that this DOES NOT mean that the modules cannot be consumed and utilized. They CAN be leveraged in all types of environments (dev, test, prod etc.). Consumers can treat them just like any other IaC module and raise issues or feature requests against them as they learn from the usage of the module. Consumers should also read the release notes for each version, if considering updating to a more recent version of a module to see if there are any considerations or breaking changes etc.
The following requirements are needed by this module:
The following resources are used by this module:
- azurerm_management_lock.this (resource)
- azurerm_resource_group.this (resource)
- azurerm_role_assignment.this (resource)
- modtm_telemetry.telemetry (resource)
- random_uuid.telemetry (resource)
- azurerm_client_config.current (data source)
- azurerm_client_config.telemetry (data source)
- modtm_module_source.telemetry (data source)
The following input variables are required:
Description: Azure region where the each of the Private Link Private DNS Zones created and Resource Group, if created, will be deployed.
Type: string
Description: The resource group where the resources will be deployed. Either the name of the new resource group to create or the name of an existing resource group.
Type: string
The following input variables are optional (have default values):
Description: This variable controls whether or not telemetry is enabled for the module.
For more information see https://aka.ms/avm/telemetryinfo.
If it is set to false, then no telemetry will be collected.
Type: bool
Default: true
Description: Controls the Resource Lock configuration for the Resource Group that hosts the Private DNS Zones. The following properties can be specified:
kind
- (Required) The type of lock. Possible values are\"CanNotDelete\"
and\"ReadOnly\"
.name
- (Optional) The name of the lock. If not specified, a name will be generated based on thekind
value. Changing this forces the creation of a new resource.
Type:
object({
kind = string
name = optional(string, null)
})
Default: null
Description: A set of Private Link Private DNS Zones to exclude. Either DNS zone names or the private_link_private_dns_zones
map key name (e.g. 'azure_ml') must match what is provided as the default values or any input to the private_link_private_dns_zones parameter e.g. privatelink.api.azureml.ms or privatelink.{regionCode}.backup.windowsazure.com or azure_ml.
Type: set(string)
Default: []
Description: A set of Private Link Private DNS Zones to create. Each element must be a valid DNS zone name.
zone_name
- The name of the Private Link Private DNS Zone to create. This can include placeholders for the region code and region name, which will be replaced with the appropriate values based on thelocation
variable.custom_iterator
- (Optional) An object that defines a custom iterator for the Private Link Private DNS Zone. This is used to create multiple Private Link Private DNS Zones with the same base name but different replacements. The object must contain:replacement_placeholder
- The placeholder to replace in thezone_name
with the custom replacement value.replacement_values
- A map of values to use for the custom iterator, where the value is the value to replace in thezone_name
.
NOTE:
- Private Link Private DNS Zones that have
{{regionCode}}
in the name will be replaced with the Geo Code of the Region you specified in thelocation
variable, if available, as documented here.- e.g. If
UK South
oruksouth
was specified as the region in thelocation
variable,{{regionCode}}
would be replaced withuks
in the Private DNS Zone name.
- e.g. If
- Private Link Private DNS Zones that have
{{regionName}}
in the name will be replaced with the short name of the Region you specified in thelocation
variable, if available, as documented here.- e.g. If
UK South
oruksouth
was specified as the region in thelocation
variable,{{regionName}}
would be replaced withuksouth
in the Private DNS Zone name.
- e.g. If
IMPORTANT:
The folowing Private Link Private DNS Zones have been removed from the default value for this variable as they require additional placeholders to be replaced that will only be known by the caller of the module at runtime and cannot be determined by the module itself. If you have a requirement to create these Private Link Private DNS Zones, you must provide the full list of Private Link Private DNS Zones to create as a set in the private_link_private_dns_zones
variable, using the default value as a reference. The list of Private Link Private DNS Zones that have been removed are:
{subzone}.privatelink.{regionName}.azmk8s.io
privatelink.{dnsPrefix}.database.windows.net
We have also removed the following Private Link Private DNS Zones from the default value for this variable as they should only be created and used with in specific scenarios:
privatelink.azure.com
Type:
map(object({
zone_name = optional(string, null)
custom_iterator = optional(object({
replacement_placeholder = string
replacement_values = map(string)
}))
}))
Default:
{
"azure_acr_data": {
"zone_name": "{regionName}.data.privatelink.azurecr.io"
},
"azure_acr_registry": {
"zone_name": "privatelink.azurecr.io"
},
"azure_ai_cog_svcs": {
"zone_name": "privatelink.cognitiveservices.azure.com"
},
"azure_ai_oai": {
"zone_name": "privatelink.openai.azure.com"
},
"azure_ai_services": {
"zone_name": "privatelink.services.ai.azure.com"
},
"azure_aks_mgmt": {
"zone_name": "privatelink.{regionName}.azmk8s.io"
},
"azure_api_management": {
"zone_name": "privatelink.azure-api.net"
},
"azure_app_configuration": {
"zone_name": "privatelink.azconfig.io"
},
"azure_app_service": {
"zone_name": "privatelink.azurewebsites.net"
},
"azure_arc_guest_configuration": {
"zone_name": "privatelink.guestconfiguration.azure.com"
},
"azure_arc_hybrid_compute": {
"zone_name": "privatelink.his.arc.azure.com"
},
"azure_arc_kubernetes": {
"zone_name": "privatelink.dp.kubernetesconfiguration.azure.com"
},
"azure_attestation": {
"zone_name": "privatelink.attest.azure.net"
},
"azure_automation": {
"zone_name": "privatelink.azure-automation.net"
},
"azure_avd_feed_mgmt": {
"zone_name": "privatelink.wvd.microsoft.com"
},
"azure_avd_global": {
"zone_name": "privatelink-global.wvd.microsoft.com"
},
"azure_backup": {
"zone_name": "privatelink.{regionCode}.backup.windowsazure.com"
},
"azure_batch": {
"zone_name": "privatelink.batch.azure.com"
},
"azure_bot_svc_bot": {
"zone_name": "privatelink.directline.botframework.com"
},
"azure_bot_svc_token": {
"zone_name": "privatelink.token.botframework.com"
},
"azure_container_apps": {
"zone_name": "privatelink.{regionName}.azurecontainerapps.io"
},
"azure_cosmos_db_analytical": {
"zone_name": "privatelink.analytics.cosmos.azure.com"
},
"azure_cosmos_db_cassandra": {
"zone_name": "privatelink.cassandra.cosmos.azure.com"
},
"azure_cosmos_db_gremlin": {
"zone_name": "privatelink.gremlin.cosmos.azure.com"
},
"azure_cosmos_db_mongo": {
"zone_name": "privatelink.mongo.cosmos.azure.com"
},
"azure_cosmos_db_postgres": {
"zone_name": "privatelink.postgres.cosmos.azure.com"
},
"azure_cosmos_db_sql": {
"zone_name": "privatelink.documents.azure.com"
},
"azure_cosmos_db_table": {
"zone_name": "privatelink.table.cosmos.azure.com"
},
"azure_data_explorer": {
"zone_name": "privatelink.{regionName}.kusto.windows.net"
},
"azure_data_factory": {
"zone_name": "privatelink.datafactory.azure.net"
},
"azure_data_factory_portal": {
"zone_name": "privatelink.adf.azure.com"
},
"azure_data_lake_gen2": {
"zone_name": "privatelink.dfs.core.windows.net"
},
"azure_databricks_ui_api": {
"zone_name": "privatelink.azuredatabricks.net"
},
"azure_digital_twins": {
"zone_name": "privatelink.digitaltwins.azure.net"
},
"azure_event_grid": {
"zone_name": "privatelink.eventgrid.azure.net"
},
"azure_file_sync": {
"zone_name": "privatelink.afs.azure.net"
},
"azure_grafana": {
"zone_name": "privatelink.grafana.azure.com"
},
"azure_hdinsight": {
"zone_name": "privatelink.azurehdinsight.net"
},
"azure_healthcare": {
"zone_name": "privatelink.azurehealthcareapis.com"
},
"azure_healthcare_dicom": {
"zone_name": "privatelink.dicom.azurehealthcareapis.com"
},
"azure_healthcare_fhir": {
"zone_name": "privatelink.fhir.azurehealthcareapis.com"
},
"azure_healthcare_workspaces": {
"zone_name": "privatelink.workspace.azurehealthcareapis.com"
},
"azure_iot_central": {
"zone_name": "privatelink.azureiotcentral.com"
},
"azure_iot_hub": {
"zone_name": "privatelink.azure-devices.net"
},
"azure_iot_hub_provisioning": {
"zone_name": "privatelink.azure-devices-provisioning.net"
},
"azure_iot_hub_update": {
"zone_name": "privatelink.api.adu.microsoft.com"
},
"azure_key_vault": {
"zone_name": "privatelink.vaultcore.azure.net"
},
"azure_log_analytics": {
"zone_name": "privatelink.oms.opinsights.azure.com"
},
"azure_log_analytics_data": {
"zone_name": "privatelink.ods.opinsights.azure.com"
},
"azure_managed_hsm": {
"zone_name": "privatelink.managedhsm.azure.net"
},
"azure_maria_db_server": {
"zone_name": "privatelink.mariadb.database.azure.com"
},
"azure_media_services_delivery": {
"zone_name": "privatelink.media.azure.net"
},
"azure_migration_service": {
"zone_name": "privatelink.prod.migration.windowsazure.com"
},
"azure_ml": {
"zone_name": "privatelink.api.azureml.ms"
},
"azure_ml_notebooks": {
"zone_name": "privatelink.notebooks.azure.net"
},
"azure_monitor": {
"zone_name": "privatelink.monitor.azure.com"
},
"azure_monitor_agent": {
"zone_name": "privatelink.agentsvc.azure-automation.net"
},
"azure_mysql_db_server": {
"zone_name": "privatelink.mysql.database.azure.com"
},
"azure_postgres_sql_server": {
"zone_name": "privatelink.postgres.database.azure.com"
},
"azure_power_bi_dedicated": {
"zone_name": "privatelink.pbidedicated.windows.net"
},
"azure_power_bi_power_query": {
"zone_name": "privatelink.tip1.powerquery.microsoft.com"
},
"azure_power_bi_tenant_analysis": {
"zone_name": "privatelink.analysis.windows.net"
},
"azure_purview_account": {
"zone_name": "privatelink.purview.azure.com"
},
"azure_purview_studio": {
"zone_name": "privatelink.purviewstudio.azure.com"
},
"azure_redis_cache": {
"zone_name": "privatelink.redis.cache.windows.net"
},
"azure_redis_enterprise": {
"zone_name": "privatelink.redisenterprise.cache.azure.net"
},
"azure_search": {
"zone_name": "privatelink.search.windows.net"
},
"azure_service_hub": {
"zone_name": "privatelink.servicebus.windows.net"
},
"azure_signalr_service": {
"zone_name": "privatelink.service.signalr.net"
},
"azure_site_recovery": {
"zone_name": "privatelink.siterecovery.windowsazure.com"
},
"azure_sql_server": {
"zone_name": "privatelink.database.windows.net"
},
"azure_static_web_apps": {
"zone_name": "privatelink.azurestaticapps.net"
},
"azure_static_web_apps_partitioned": {
"custom_iterator": {
"replacement_placeholder": "partitionId",
"replacement_values": {
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5"
}
},
"zone_name": "privatelink.{partitionId}.azurestaticapps.net"
},
"azure_storage_blob": {
"zone_name": "privatelink.blob.core.windows.net"
},
"azure_storage_file": {
"zone_name": "privatelink.file.core.windows.net"
},
"azure_storage_queue": {
"zone_name": "privatelink.queue.core.windows.net"
},
"azure_storage_table": {
"zone_name": "privatelink.table.core.windows.net"
},
"azure_storage_web": {
"zone_name": "privatelink.web.core.windows.net"
},
"azure_synapse": {
"zone_name": "privatelink.azuresynapse.net"
},
"azure_synapse_dev": {
"zone_name": "privatelink.dev.azuresynapse.net"
},
"azure_synapse_sql": {
"zone_name": "privatelink.sql.azuresynapse.net"
},
"azure_web_pubsub": {
"zone_name": "privatelink.webpubsub.azure.com"
}
}
Description: A set of Private Link Private DNS Zones to create in addition to the zones supplied in private_link_private_dns_zones
. Each element must be a valid DNS zone name.
The purpose of this variable is to allow the use of our default zones and just add any additional zones without having to redefine the entire set of default zones.
zone_name
- The name of the Private Link Private DNS Zone to create. This can include placeholders for the region code and region name, which will be replaced with the appropriate values based on thelocation
variable.custom_iterator
- (Optional) An object that defines a custom iterator for the Private Link Private DNS Zone. This is used to create multiple Private Link Private DNS Zones with the same base name but different replacements. The object must contain:replacement_placeholder
- The placeholder to replace in thezone_name
with the custom iterator replacement value.replacement_values
- A map of values to use for the custom iterator, where the value is the value to replace in thezone_name
.
Type:
map(object({
zone_name = optional(string, null)
custom_iterator = optional(object({
replacement_placeholder = string
replacement_values = map(string)
}))
}))
Default: {}
Description: This variable controls whether or not the resource group should be created. If set to false, the resource group must be created elsewhere and the resource group name must be provided to the module. If set to true, the resource group will be created by the module using the name provided in resource_group_name
.
Type: bool
Default: true
Description: A map of role assignments to create on the Resource Group. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.
role_definition_id_or_name
- The ID or name of the role definition to assign to the principal.principal_id
- The ID of the principal to assign the role to.description
- The description of the role assignment.skip_service_principal_aad_check
- If set to true, skips the Azure Active Directory check for the service principal in the tenant. Defaults to false.condition
- The condition which will be used to scope the role assignment.condition_version
- The version of the condition syntax. Valid values are '2.0'.
Note: only set
skip_service_principal_aad_check
to true if you are assigning a role to a service principal.
Type:
map(object({
role_definition_id_or_name = string
principal_id = string
description = optional(string, null)
skip_service_principal_aad_check = optional(bool, false)
condition = optional(string, null)
condition_version = optional(string, null)
delegated_managed_identity_resource_id = optional(string, null)
}))
Default: {}
Description: (Optional) Tags of the resource.
Type: map(string)
Default: null
Description: A map of timeouts objects, per resource type, to apply to the creation and destruction of resources the following resources:
dns_zones
- (Optional) The timeouts for DNS Zones.vnet_links
- (Optional) The timeouts for DNS Zones Virtual Network Links.
Each timeout object has the following optional attributes:
create
- (Optional) The timeout for creating the resource. Defaults to5m
apart from policy assignments, where this is set to15m
.delete
- (Optional) The timeout for deleting the resource. Defaults to5m
.update
- (Optional) The timeout for updating the resource. Defaults to5m
.read
- (Optional) The timeout for reading the resource. Defaults to5m
.
Type:
object({
dns_zones = optional(object({
create = optional(string, "30m")
delete = optional(string, "30m")
update = optional(string, "30m")
read = optional(string, "5m")
}), {}
)
vnet_links = optional(object({
create = optional(string, "30m")
delete = optional(string, "30m")
update = optional(string, "30m")
read = optional(string, "5m")
}), {}
)
})
Default: {}
Description: A prefix to use for the names of the Virtual Network Links created.
The zone_key and vnet_key will be replaced with the keys of the DNS zone and Virtual Network respectively.
Type: string
Default: "vnet_link-${zone_key}-${vnet_key}"
Description: A map of objects of Virtual Network Resource IDs to link to the Private Link Private DNS Zones created. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.
vnet_resource_id
- (Optional) The resource ID of the Virtual Network to link to the Private Link Private DNS Zones created to.virtual_network_link_name_template_override
- (Optional) An override for the name of the Virtual Network Link to create. If not specified, the name will be generated based on thevirtual_network_link_name_template
variable and the dns zone key and virtual network map key. This name will apply to every DNS zone link for that virtual network.
Type:
map(object({
vnet_resource_id = optional(string, null)
virtual_network_link_name_template_override = optional(string, null)
}))
Default: {}
The following outputs are exported:
Description: The final map of private link private DNS zones to link to virtual networks including the region name replacements as required.
Description: The map of private DNS zones to resource ids.
Description: The resource ID of the resource group that the Private DNS Zones are deployed into.
The following Modules are called:
Source: Azure/avm-res-network-privatednszone/azurerm
Version: 0.3.0
Source: Azure/avm-utl-regions/azurerm
Version: 0.5.0
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.