Azure DNS Aaaa Record

This page shows how to write Terraform and Azure Resource Manager for DNS Aaaa Record and write them securely.

azurerm_dns_aaaa_record (Terraform)

The Aaaa Record in DNS can be configured in Terraform with the resource name azurerm_dns_aaaa_record. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

jitsirocks.tf#L98
resource "azurerm_dns_aaaa_record" "custom01" {
  name                = "custom01"
  zone_name           = azurerm_dns_zone.jitsi_rocks_dns.name
  resource_group_name = azurerm_resource_group.openinfrastructure_rg.name
  ttl                 = 3600
  records             = ["2a01:4f8:c17:4db1::1"]
dns_aaaa_record_test.tf#L15
resource "azurerm_dns_aaaa_record" "over1B" {
  name                = "test"
  zone_name           = azurerm_dns_zone.example.name
  resource_group_name = azurerm_resource_group.example.name
  ttl                 = 300
  records             = ["2001:db8::1:0:0:1"]
record_aaaa.tf#L1
resource "azurerm_dns_aaaa_record" "aaaa" {
  for_each = {
    for key, value in try(var.records.aaaa, {}) : key => value
    if try(value.resource_id, null) == null
  }

record_aaaa.tf#L1
resource "azurerm_dns_aaaa_record" "aaaa" {
  for_each = {
    for key, value in try(var.records.aaaa, {}) : key => value
    if try(value.resource_id, null) == null
  }

record_aaaa.tf#L1
resource "azurerm_dns_aaaa_record" "aaaa" {
  for_each = {
    for key, value in try(var.records.aaaa, {}) : key => value
    if try(value.resource_id, null) == null
  }

webpage.tf#L9
resource "azurerm_dns_aaaa_record" "default_www_openinfra" {
  name                = "@"
  zone_name           = azurerm_dns_zone.openinfrastructure_dns.name
  resource_group_name = azurerm_resource_group.openinfrastructure_rg.name
  ttl                 = 3600
  records             = ["2a01:4f9:c010:2dba::1"]
record_aaaa.tf#L1
resource "azurerm_dns_aaaa_record" "aaaa" {
  for_each = {
    for key, value in try(var.records.aaaa, {}) : key => value
    if try(value.resource_id, null) == null
  }

devops.tf#L19
resource "azurerm_dns_aaaa_record" "git_openinfra" {
  name                = "git"
  zone_name           = azurerm_dns_zone.openinfrastructure_dns.name
  resource_group_name = azurerm_resource_group.openinfrastructure_rg.name
  ttl                 = 3600
  records             = ["2a01:4f8:c17:b9f1::1"]
aaaa_record.tf#L14
resource "azurerm_dns_aaaa_record" "aaaa_record_public_with_zone" {
  count               = var.create_dns_zone ? (var.public_dns_zone ? length(var.aaaa_records) : 0) : 0

  zone_name           = var.zone_name
  resource_group_name = var.resource_group_name

dns_aaaa_record_test.tf#L15
resource "azurerm_dns_aaaa_record" "over1B" {
  name                = "test"
  zone_name           = azurerm_dns_zone.example.name
  resource_group_name = azurerm_resource_group.example.name
  ttl                 = 300
  records             = ["2001:db8::1:0:0:1"]

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 DNS AAAA Records within Azure DNS.

Microsoft.Network/dnszones/AAAA (Azure Resource Manager)

The dnszones/AAAA in Microsoft.Network can be configured in Azure Resource Manager with the resource name Microsoft.Network/dnszones/AAAA. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

updatedns.json
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "zone": {
AAAARecords.json#L16
            "type": "Microsoft.Network/dnszones/AAAA",
            "name": "[concat(parameters('DNSObj').dnsZoneName, '/', parameters('DNSObj').AAAARecords[copyIndex()].name)]",
            "apiVersion": "2018-05-01",
            "copy": {
                "name": "obj",
                "count": "[length(parameters('DNSObj').AAAARecords)]"
AAAARecords.json#L16
            "type": "Microsoft.Network/dnszones/AAAA",
            "name": "[concat(parameters('DNSObj').dnsZoneName, '/', parameters('DNSObj').AAAARecords[copyIndex()].name)]",
            "apiVersion": "2018-05-01",
            "copy": {
                "name": "obj",
                "count": "[length(parameters('DNSObj').AAAARecords)]"
AAAARecords.json#L16
            "type": "Microsoft.Network/dnszones/AAAA",
            "name": "[concat(parameters('DNSObj').dnsZoneName, '/', parameters('DNSObj').AAAARecords[copyIndex()].name)]",
            "apiVersion": "2018-05-01",
            "copy": {
                "name": "obj",
                "count": "[length(parameters('DNSObj').AAAARecords)]"
AAAARecords.json#L16
            "type": "Microsoft.Network/dnszones/AAAA",
            "name": "[concat(parameters('DNSObj').dnsZoneName, '/', parameters('DNSObj').AAAARecords[copyIndex()].name)]",
            "apiVersion": "2018-05-01",
            "copy": {
                "name": "obj",
                "count": "[length(parameters('DNSObj').AAAARecords)]"

Frequently asked questions

What is Azure DNS Aaaa Record?

Azure DNS Aaaa Record is a resource for DNS of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure DNS Aaaa Record?

For Terraform, the open-infrastructure/infrastructure-as-code, gilyas/infracost and anmoltoppo/Terraform source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the martgras/armdemo, canada-ca/accelerators_accelerateurs-azure and canada-ca/accelerators_accelerateurs-azure source code examples are useful. See the Azure Resource Manager Example section for further details.