From 243bfcff70f83d1f97ffa604357bdec59ff4f02e Mon Sep 17 00:00:00 2001 From: Gillian Stravers Date: Mon, 2 Dec 2024 14:55:53 +0100 Subject: [PATCH 1/2] fix: make custom rules optional and remove vnetlinks --- main.tf | 8 -------- variables.tf | 6 +++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/main.tf b/main.tf index 8655ddd..5d0f59c 100644 --- a/main.tf +++ b/main.tf @@ -91,12 +91,4 @@ resource "azurerm_private_dns_resolver_forwarding_rule" "this" { port = target_dns_servers.value.port } } -} - -resource "azurerm_private_dns_resolver_virtual_network_link" "this" { - count = var.private_dns_resolver_outbound_endpoint.enabled ? 1 : 0 - - name = "${var.private_dns_resolver.virtual_network_name}-link" - dns_forwarding_ruleset_id = azurerm_private_dns_resolver_dns_forwarding_ruleset.this[0].id - virtual_network_id = var.private_dns_resolver.virtual_network_id } \ No newline at end of file diff --git a/variables.tf b/variables.tf index 2d667e4..9731448 100644 --- a/variables.tf +++ b/variables.tf @@ -52,11 +52,11 @@ variable "private_dns_resolver_forwarding_ruleset" { variable "private_dns_resolver_forwarding_rule" { description = "Private DNS resolver forwarding rule configuration" type = map(object({ - name = string - domain_name = string + name = optional(string, null) + domain_name = optional(string, null) enabled = optional(bool, true) target_dns_servers = list(object({ - ip_address = string + ip_address = optional(string, null) port = optional(number, 53) })) })) From 7e373de38a4808d4f9f3adf0ef3a29db63b1ad2b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 2 Dec 2024 13:56:44 +0000 Subject: [PATCH 2/2] docs(readme): update module usage --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index de9de86..1a041e8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,6 @@ No modules. | [azurerm_private_dns_resolver_forwarding_rule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_resolver_forwarding_rule) | resource | | [azurerm_private_dns_resolver_inbound_endpoint.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_resolver_inbound_endpoint) | resource | | [azurerm_private_dns_resolver_outbound_endpoint.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_resolver_outbound_endpoint) | resource | -| [azurerm_private_dns_resolver_virtual_network_link.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_resolver_virtual_network_link) | resource | | [azurerm_resource_group.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource | ## Inputs @@ -34,7 +33,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [private\_dns\_resolver](#input\_private\_dns\_resolver) | Private DNS resolver configuration |
object({
name = string
virtual_network_id = string
virtual_network_name = string
})
| n/a | yes | -| [private\_dns\_resolver\_forwarding\_rule](#input\_private\_dns\_resolver\_forwarding\_rule) | Private DNS resolver forwarding rule configuration |
map(object({
name = string
domain_name = string
enabled = optional(bool, true)
target_dns_servers = list(object({
ip_address = string
port = optional(number, 53)
}))
}))
| n/a | yes | +| [private\_dns\_resolver\_forwarding\_rule](#input\_private\_dns\_resolver\_forwarding\_rule) | Private DNS resolver forwarding rule configuration |
map(object({
name = optional(string, null)
domain_name = optional(string, null)
enabled = optional(bool, true)
target_dns_servers = list(object({
ip_address = optional(string, null)
port = optional(number, 53)
}))
}))
| n/a | yes | | [private\_dns\_resolver\_forwarding\_ruleset](#input\_private\_dns\_resolver\_forwarding\_ruleset) | Private DNS resolver forwarding ruleset configuration |
object({
name = string
})
| n/a | yes | | [private\_dns\_resolver\_inbound\_endpoint](#input\_private\_dns\_resolver\_inbound\_endpoint) | Private DNS resolver inbound endpoint configuration |
object({
name = string
ip_configurations = list(object({
private_ip_allocation_method = optional(string, "Static")
subnet_id = string
private_ip_address = optional(string, null)
}))
})
| n/a | yes | | [private\_dns\_resolver\_outbound\_endpoint](#input\_private\_dns\_resolver\_outbound\_endpoint) | Private DNS resolver outbound endpoint configuration |
object({
enabled = optional(bool, true)
name = string
subnet_id = string
})
| n/a | yes |