Skip to content

Module and utilities to manage public DNS zones and records on Azure

Notifications You must be signed in to change notification settings

benjamin-v1/azure-public-dns

 
 

Repository files navigation

Azure DNS Zone Recordsets Module

This module creates/updates DNS zone and recordsets in a given zone.

Example Usage.

../../components/mgmt.main.tf

module "public-dns" {
  source = "hmcts/azure-platform-terraform/modules/azure-public-dns"
  project            = var.project
}

azure-platform-terraform/azure-public-dns/dns-zones.auto.tfvars

  zones = [
    "test.example.com"
  ]

azure-platform-terraform/azure-public-dns/dns-zones.auto.tfvars

  recordsets = [
    {
      name    = "www"
      type    = "A"
      ttl     = 3600
      records = [
        "192.0.2.56",
      ]
    },
    {
      name    = ""
      type    = "MX"
      ttl     = 3600
      records = [
        "1 mail1",
        "5 mail2",
        "5 mail3",
      ]
    },
    {
      name    = "_sip._tcp"
      type    = "SRV"
      ttl     = 3600
      records = [
        "10 60 5060 sip1",
        "10 20 5060 sip2",
        "10 20 5060 sip3",
        "20 0 5060 sip4",
      ]
    }
  ]

Terraform Plan Example

[In the azure-public-dns/components/ directory] $ terraform plan -var-file='../../environemtnts/.tfvars

For example: [In the the azure-public-dns/components/sbox directory] ../azure-public-dns/components/sbox$ terraform plan -var-file='../../environemtnts/sbox.tfvars

Arguments

  • resource_group_name is the name of the resource group that contains the DNS zone where the records will be added.
  • dns_zone_name is the name of the DNS zone within the given resource group where the records will be added.

This module requires the azurerm provider.

Due to current limitations of the Terraform language, recordsets in Azure DNS are correlated to recordsets elements using the index into the recordsets list. Adding or removing records from the list will therefore cause this module to also update all records with indices greater than where the addition or removal was made.

Limitations

This module supports only the following DNS record types, due to limitations of the underlying Terraform provider:

  • A
  • AAAA
  • CNAME
  • MX
  • NS
  • PTR
  • SRV
  • TXT

About

Module and utilities to manage public DNS zones and records on Azure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 91.3%
  • Shell 8.7%