Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
add azurerm_virtual_network_dns_servers resource block
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Nov 12, 2024
1 parent 92c794b commit e420870
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ resource "azurerm_virtual_network" "vnet" {
}
}

resource "azurerm_virtual_network_dns_servers" "this" {
count = var.dns_servers != null ? 1 : 0

virtual_network_id = azurerm_virtual_network.vnet.id
dns_servers = var.dns_servers
}

moved {
from = azurerm_subnet.subnet
to = azurerm_subnet.subnet_count
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ variable "ddos_protection_plan" {
description = "The set of DDoS protection plan configuration"
}

# If no values specified, this defaults to Azure DNS
variable "dns_servers" {
type = list(string)
default = []
description = "The DNS servers to be used with vNet."
}

variable "nsg_ids" {
type = map(string)
default = {
Expand Down

0 comments on commit e420870

Please sign in to comment.