Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom dns servers in vnet sub-module #76

Closed
jinkang23 opened this issue Jul 18, 2024 · 1 comment · Fixed by #85
Closed

Add support for custom dns servers in vnet sub-module #76

jinkang23 opened this issue Jul 18, 2024 · 1 comment · Fixed by #85
Assignees
Labels
enhancement New feature or request

Comments

@jinkang23
Copy link

Is your feature request related to a problem?

In our Azure environment, we utilize Azure DNS Private Resolver with inbound endpoints in a separate spoke VNET. The Hub NGFW Firewall's VNET by default is configured to point to the Default (Azure-provided) DNS servers. Although we can workaround this by setting the DNS servers via the azurerm_virtual_network_dns_servers resource outside of this module, I would like to see support for specifying custom DNS servers natively within this vnet sub-module.

Describe the solution you'd like

Add new optional variable to specify custom DNS servers and update azurerm_virtual_network resource to accept these values.

variable "dns_servers" {
  type = list(string)
  default = null
}


resource "azurerm_virtual_network" "this" {
  count = var.create_virtual_network ? 1 : 0

  name                = var.name
  location            = var.region
  resource_group_name = var.resource_group_name
  address_space       = var.address_space

  dns_servers         = var.dns_servers #<-- set the custom DNS server(s)

  tags                = var.tags

  dynamic "encryption" {
    for_each = var.vnet_encryption != null ? [1] : []
    content {
      enforcement = var.vnet_encryption
    }
  }

  lifecycle {
    precondition {
      condition     = length(coalesce(var.address_space, [])) > 0
      error_message = "The `var.address_space` property is required when creating a VNET."
    }
  }
}

Describe alternatives you've considered.

Use azurerm_virtual_network_dns_servers resource outside of this module.

Additional context

No response

@jinkang23 jinkang23 added the enhancement New feature or request label Jul 18, 2024
@acelebanski acelebanski self-assigned this Aug 8, 2024
@acelebanski acelebanski linked a pull request Aug 29, 2024 that will close this issue
4 tasks
@acelebanski
Copy link
Contributor

Hi @jinkang23, thanks for raising this feature request. This will be added by PR #85 and should be released soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants