Skip to content

Azure/terraform-azurerm-avm-res-network-privatednszone

Repository files navigation

Azure Verified Module for Private DNS Zone

This module provides a generic way to create and manage Private DNS zones in Azure.

To use this module in your Terraform configuration, you'll need to provide values for the required variables. Here's a basic example:

module "azure_privatednszone" {
  source = "./path_to_this_module"

  // ... mandatory variables ...
  domain_name = "your.domain.com"
  resource_group_name = "existing_resourcegroup_name"

  // ... other optional variables, see example ...
}

Requirements

The following requirements are needed by this module:

Providers

The following providers are used by this module:

Resources

The following resources are used by this module:

Required Inputs

The following input variables are required:

Description: The name of the private dns zone.

Type: string

Description: The resource group where the resources will be deployed.

Type: string

Optional Inputs

The following input variables are optional (have default values):

Description: A map of objects where each object contains information to create a A record.

Type:

map(object({
    name                = string
    resource_group_name = string
    zone_name           = string
    ttl                 = number
    records             = list(string)
    tags                = optional(map(string), null)
  }))

Default: {}

Description: A map of objects where each object contains information to create a AAAA record.

Type:

map(object({
    name                = string
    resource_group_name = string
    zone_name           = string
    ttl                 = number
    records             = list(string)
    tags                = optional(map(string), null)
  }))

Default: {}

Description: A map of objects where each object contains information to create a CNAME record.

Type:

map(object({
    name                = string
    resource_group_name = string
    zone_name           = string
    ttl                 = number
    record              = string
    tags                = optional(map(string), null)
  }))

Default: {}

Description: The tags to associate with your private dns zone.

Type: map(string)

Default: {}

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: A map of objects where each object contains information to create a MX record.

Type:

map(object({
    name                = optional(string, "@")
    resource_group_name = string
    zone_name           = string
    ttl                 = number
    records = map(object({
      preference = number
      exchange   = string
    }))
    tags = optional(map(string), null)
  }))

Default: {}

Description: A map of objects where each object contains information to create a PTR record.

Type:

map(object({
    name                = string
    resource_group_name = string
    zone_name           = string
    ttl                 = number
    records             = list(string)
    tags                = optional(map(string), null)
  }))

Default: {}

Description: optional soa_record variable, if included only email is required, rest are optional. Email must use username.corp.com and not username@corp.com

Type:

object({
    email        = string
    expire_time  = optional(number, 2419200)
    minimum_ttl  = optional(number, 10)
    refresh_time = optional(number, 3600)
    retry_time   = optional(number, 300)
    ttl          = optional(number, 3600)
    tags         = optional(map(string), null)
  })

Default: null

Description: A map of objects where each object contains information to create a SRV record.

Type:

map(object({
    name                = string
    resource_group_name = string
    zone_name           = string
    ttl                 = number
    records = map(object({
      priority = number
      weight   = number
      port     = number
      target   = string
    }))
    tags = optional(map(string), null)
  }))

Default: {}

Description: A mapping of tags to assign to the telemetry resources.

Type: map(string)

Default: {}

Description: A map of objects where each object contains information to create a TXT record.

Type:

map(object({
    name                = string
    resource_group_name = string
    zone_name           = string
    ttl                 = number
    records = map(object({
      value = string
    }))
    tags = optional(map(string), null)
  }))

Default: {}

Description: A map of objects where each object contains information to create a virtual network link.

Type:

map(object({
    vnetlinkname     = string
    vnetid           = string
    autoregistration = optional(bool, false)
    tags             = optional(map(string), null)
  }))

Default: {}

Outputs

The following outputs are exported:

Description: The a record output

Description: The aaaa record output

Description: The cname record output

Description: The mx record output

Description: The private dns zone output

Description: The ptr record output

Description: The srv record output

Description: The txt record output

Description: The virtual network link output

Modules

No modules.

Data Collection

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.