This Terraform module manages Azure DNS Zones and records. It provisions DNS zones, associated records (A, AAAA,CNAME, MX, TXT, SRV, PTR, CAA), and configures necessary settings.
Azure DNS is a hosting service for DNS domains that provides name resolution using Microsoft Azure infrastructure. This module provides an easy way to deploy and manage DNS zones and records using Terraform.
- Creates an Azure DNS Zone with specified configurations.
- Manages DNS records (A,AAAA, CNAME, MX, TXT, SRV, PTR, CAA).
- Supports configuring TTL for DNS records.
- Allows tagging of resources for better management.
- Provides easy-to-use variables for common configurations.
module "dns_zones" {
source = "../../"
# Resurce configuration
resource_group_name = var.resource_group_name
resource_group_location = var.resource_group_location
lock_level_value = var.lock_level_value
# DNS zone configuragtion
dns_zones = var.dns_zones
# DNS zone Records
dns_a_records = var.dns_a_records
dns_aaaa_records = var.dns_aaaa_records
dns_cname_records = var.dns_cname_records
dns_mx_records = var.dns_mx_records
dns_txt_records = var.dns_txt_records
dns_ns_records = var.dns_ns_records
dns_caa_records = var.dns_caa_records
dns_srv_records = var.dns_srv_records
dns_ptr_records = var.dns_ptr_records
# Additional Configurations
tags = var.tags
}
This example demonstrates a basic setup of an Azure DNS Zone using Terraform. It covers essential configurations to get started with DNS management in your Azure environment.
2- Advanced Setup with Multiple Record Types
Explore this example to learn how to deploy an Azure DNS Zone with various DNS record types using Terraform. This setup ensures comprehensive DNS management for your Azure services.
Name | Description | Type | Default | Required |
---|---|---|---|---|
resource_group_name | The name of the Resource Group | string | n/a | yes |
resource_group_location | The Location for the Resource Group | string | n/a | yes |
dns_zones | Name of the DNS zoen to be create | map(string) | n/a | yes |
Name | Description | Type | Default | Required |
---|---|---|---|---|
dns_a_records | List of A records to create | map | {} | no |
Name | Description | Type | Default | Required |
---|---|---|---|---|
dns_aaaa_records | List of AAAA records to create | map | {} | no |
Name | Description | Type | Default | Required |
---|---|---|---|---|
dns_cname_records | List of CNAME records to create | map | {} | no |
Name | Description | Type | Default | Required |
---|---|---|---|---|
dns_mx_records | List of MX records to create | map | {} | no |
Name | Description | Type | Default | Required |
---|---|---|---|---|
dns_txt_records | List of TXT records to create | map | {} | no |
Name | Description | Type | Default | Required |
---|---|---|---|---|
dns_srv_records | List of SRV Records to create | map | {} | no |
Name | Description | Type | Default | Required |
---|---|---|---|---|
dns_ptr_records | List of PTR Records to create | map | {} | no |
Name | Description | Type | Default | Required |
---|---|---|---|---|
dns_caa_records | List of CAA Records to create | map | {} | no |
Name | Description | Type | Default | Required |
---|---|---|---|---|
tags | Common Tags for the resources be be create | map(string) | Name of the resource | no |
create_resource_group | Whether to create the Resource Group | bool | true | no |
create_dns_zone | Whether to create the DNS zone | bool | true | no |