项目作者: uncleyo

项目描述 :
Split-horizon Azure DNS Zones (with private zone resolvers)
高级语言: HCL
项目地址: git://github.com/uncleyo/terraform-azurerm-dns.git
创建时间: 2019-04-02T13:00:43Z
项目社区:https://github.com/uncleyo/terraform-azurerm-dns

开源协议:

下载


Split-horizon Azure DNS zones (with private zone resolvers)

Deploy public and private Azure DNS Zones and virtual network with highly available resolvers.

Why?

Currently, zone delegation for Private DNS Zones on Azure is not supported. It’s in the roadmap, but timing is unknown. This module enables zone delegation for private on-premises resolvers already now, by deploying recursive resolver VMs to a private resolution network.

Based on https://github.com/Azure/azure-quickstart-templates/tree/master/301-dns-forwarder, but for Terraform and with HA.

What?

The module will, depending on the configuration, deploy:

  • Zero or more public DNS Zones into ${var.prefix}-public-zones resource group. The group will only be created if var.public_zones length is greater than 0.
  • Zero or more private DNS Zones into ${var.prefix}-private-zones resource group.
  • One virtual network, subnet and network security group
  • One or more resolver VMs into the subnet with bind configured to recursively resolve all DNS queries using Azure’s standard 168.63.129.16.

Only Azure regions with Availability Zones are supported.

How?

main.tf

  1. module "dns" {
  2. source = "uncleyo/dns/azurerm"
  3. version = "0.1.0"
  4. # required variables:
  5. location = "West Europe"
  6. public_zones = [
  7. "example.org"
  8. ]
  9. private_zones = [
  10. "example.org",
  11. "local.only"
  12. ]
  13. resolver_vm_admin_username = "admin"
  14. resolver_vm_admin_ssh_pub_key_file = "~/.ssh/id_rsa.pub"
  15. # optional variables with default values:
  16. prefix = "dns"
  17. tags = {}
  18. debug_enable_resolver_public_ips = false
  19. availability_zones = [1, 2, 3]
  20. resolver_count = 2
  21. resolver_vnet_prefix = "10.53.53.0/24"
  22. resolver_subnet_prefix = "10.53.53.0/24"
  23. resolver_ip_offset = 4
  24. resolver_vm_size = Standard_B1ls
  25. resolver_ssh_client_whitelist = [
  26. "10.0.0.0/8",
  27. "172.16.0.0/12",
  28. "192.168.0.0/16"
  29. ]
  30. resolver_dns_client_whitelist = [
  31. "10.0.0.0/8",
  32. "172.16.0.0/12",
  33. "192.168.0.0/16"
  34. ]
  35. }

TODO:

  • Add support for existing virtual network / subnet?