How azure-terraform/terraform-azurerm-dns-zone works
Project type and purpose
• This is an Infrastructure-as-Code (IaC) Terraform module designed to automate the creation of a delegated DNS zone in Azure.
• It manages two Azure subscriptions (parent and child), creates a child DNS zone in the child subscription, and inserts NS records into an existing parent DNS zone in the parent subscription.
File structure
• Top-level Terraform files:
• provider.tf – configures azurerm.child and azurerm.parent providers
• versions.tf – declares Terraform version and provider version constraints
• variables.tf – defines module inputs (child/parent subscription IDs, RG names, domain prefixes, tags)
• main.tf – declares Azure DNS zone and NS record resources
• output.tf – exposes module outputs (zone id, name, RG, subscription)
• main.tf, output.tf complement each other to produce the module’s public interface.
• CI configuration:
• .github/workflows/documentation.yml – GitHub Action to build docs (no runtime pipeline here).
README for additional insights
• The module uses two named providers to operate across subscriptions.
• Inputs and outputs are well documented – this helps highlight the boundaries of the module.
• Example usage shows how a consumer invokes the module, passing in RG names, subscription IDs, domain names, and tags.
Elements
• Clear labels: e.g., “Terraform CLI,” “azurerm.parent provider,” “Parent Subscription,” “Parent DNS Zone,” “azurerm.child provider,” “Child Subscription,” “Child DNS Zone,” “NS Record Delegation.”
• From Terraform → azurerm.parent → Fetch/Read Parent DNS Zone
• From Terraform → azurerm.child → Create Child DNS Zone
• From Terraform → azurerm.parent → Create NS Record
• Rectangle (blue) for Terraform components (CLI, providers)
Detailed breakdown
• one labeled “data.azurerm_dns_zone.read” pointing to “Parent DNS Zone,”
• one labeled “azurerm_dns_ns_record.create” pointing to “Parent DNS Zone.”
8. At the bottom, list module inputs feeding into Terraform (variables.tf) and outputs feeding back to caller (output.tf).