Skip to content

opsstation/terraform-azure-dns

Repository files navigation

Terraform-azure-dns

Terraform Azure Cloud DNS Module

Table of Contents

Introduction

This repository contains Terraform code to deploy resources on Microsoft Azure, including a resource group and a dns.

Usage

To use this module, you should have Terraform installed and configured for AZURE. This module provides the necessary Terraform configuration for creating AZURE resources, and you can customize the inputs as needed. Below is an example of how to use this module:

Example: log-analytics

module "dns_zone" {
  depends_on                   = [module.resource_group, module.vnet]
  source      = "git::https://github.com/opsstation/terraform-azuredns-.git?ref=v1.0.0"
  name                         = local.name
  environment                  = local.environment
  resource_group_name          = module.resource_group.resource_group_name
  dns_zone_names               = "example0000.com"
  private_registration_enabled = true
  private_dns                  = true
  private_dns_zone_name        = "webserver0000.com"
  virtual_network_id           = module.vnet.vnet_id
  a_records = [{
    name    = "test"
    ttl     = 3600
    records = ["10.0.180.17", "10.0.180.18"]
  },
    {
      name    = "test2"
      ttl     = 3600
      records = ["10.0.180.17", "10.0.180.18"]
    }]

  cname_records = [{
    name   = "test1"
    ttl    = 3600
    record = "example.com"
  }]

  ns_records = [{
    name    = "test2"
    ttl     = 3600
    records = ["ns1.example.com.", "ns2.example.com."]
  }]
}

This example demonstrates how to create various AZURE resources using the provided modules. Adjust the input values to suit your specific requirements.

Examples

For detailed examples on how to use this module, please refer to the example directory within this repository.

License

This Terraform module is provided under the MIT License. Please see the LICENSE file for more details.

Author

Your Name Replace MIT and OpsStation with the appropriate license and your information. Feel free to expand this README with additional details or usage instructions as needed for your specific use case.

Requirements

Name Version
terraform >= 1.3.0
azurerm >=2.90.0
random 3.0.0

Providers

Name Version
azurerm >=2.90.0
random 3.0.0

Modules

Name Source Version
labels git::https://github.com/opsstation/terraform-azure-labels.git v1.0.0

Resources

Name Type
azurerm_dns_a_record.records_a resource
azurerm_dns_cname_record.records_cname resource
azurerm_dns_ns_record.records_ns resource
azurerm_dns_zone.dns_zone resource
azurerm_private_dns_zone.private_dns_zone resource
azurerm_private_dns_zone_virtual_network_link.private_dns_vnet_link resource
random_id.this resource

Inputs

Name Description Type Default Required
a_records List of a records to be added in azure dns zone. any [] no
cname_records List of cname records any [] no
dns_zone_names The public dns zone to be created for internal vnet resolution string null no
enabled n/a bool true no
enabled_dns n/a bool true no
environment Environment (e.g. prod, dev, staging). string "" no
label_order Label order, e.g. sequence of application name and environment name,environment,'attribute' [webserver,qa,devops,public,] . list(any)
[
"name",
"environment"
]
no
managedby ManagedBy, eg 'opsstation'. string "" no
name Name (e.g. app or cluster). string "" no
ns_records List of ns records
list(object({
name = string, #(Required) The name of the DNS NS Record. Changing this forces a new resource to be created.
ttl = number, # (Required) The Time To Live (TTL) of the DNS record in seconds.
records = list(string) #(Required) A list of values that make up the NS record.
}))
[] no
private_dns n/a bool false no
private_dns_zone_name The private dns zone to be created for internal vnet resolution string null no
private_registration_enabled Is auto-registration of virtual machine records in the virtual network in the Private DNS zone enabled? bool true no
repository Terraform current module repo string "https://github.com/opsstation/terraform-azure-dns" no
resource_group_name The name of the resource group where the Azure DNS resides string "" no
soa_record Customize details about the root block device of the instance. See Block Devices below for details. list(any) [] no
virtual_network_id The name of the virtual network string "" no

Outputs

Name Description
dns_a_record_fqdn The FQDN of the DNS A Record.
dns_a_record_id The DNS A Record ID.
dns_cname_record_fqdn The FQDN of the DNS CNAME Record.
dns_cname_record_id The DNS CNAME Record ID.
dns_ns_record_fqdn The FQDN of the DNS NS Record.
dns_ns_record_id The DNS NS Record ID.
dns_zone_id The DNS Zone ID.
dns_zone_max_number_of_record_sets Maximum number of Records in the zone. Defaults to 1000.
dns_zone_name_servers A list of values that make up the NS record for the zone.
dns_zone_number_of_record_sets The number of records already in the zone.
private_dns_zone_id The Private DNS Zone ID.
private_dns_zone_max_number_of_record_sets The maximum number of record sets that can be created in this Private DNS zone.
private_dns_zone_max_number_of_virtual_network_links The maximum number of virtual networks that can be linked to this Private DNS zone.
private_dns_zone_max_number_of_virtual_network_links_with_registration The maximum number of virtual networks that can be linked to this Private DNS zone with registration enabled.
private_dns_zone_number_of_record_sets The current number of record sets in this Private DNS zone.
private_dns_zone_virtual_network_link_id The ID of the Private DNS Zone Virtual Network Link.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages