Skip to content

Commit

Permalink
Merge pull request #10 from schubergphilis/fix/make-forwardig-rule-op…
Browse files Browse the repository at this point in the history
…tional

fix: make custom rules optional and remove vnetlinks
  • Loading branch information
gillianstravers authored Dec 2, 2024
2 parents 74378cc + 7e373de commit 2c819d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ 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

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_private_dns_resolver"></a> [private\_dns\_resolver](#input\_private\_dns\_resolver) | Private DNS resolver configuration | <pre>object({<br> name = string<br> virtual_network_id = string<br> virtual_network_name = string<br> })</pre> | n/a | yes |
| <a name="input_private_dns_resolver_forwarding_rule"></a> [private\_dns\_resolver\_forwarding\_rule](#input\_private\_dns\_resolver\_forwarding\_rule) | Private DNS resolver forwarding rule configuration | <pre>map(object({<br> name = string<br> domain_name = string<br> enabled = optional(bool, true)<br> target_dns_servers = list(object({<br> ip_address = string<br> port = optional(number, 53)<br> }))<br> }))</pre> | n/a | yes |
| <a name="input_private_dns_resolver_forwarding_rule"></a> [private\_dns\_resolver\_forwarding\_rule](#input\_private\_dns\_resolver\_forwarding\_rule) | Private DNS resolver forwarding rule configuration | <pre>map(object({<br> name = optional(string, null)<br> domain_name = optional(string, null)<br> enabled = optional(bool, true)<br> target_dns_servers = list(object({<br> ip_address = optional(string, null)<br> port = optional(number, 53)<br> }))<br> }))</pre> | n/a | yes |
| <a name="input_private_dns_resolver_forwarding_ruleset"></a> [private\_dns\_resolver\_forwarding\_ruleset](#input\_private\_dns\_resolver\_forwarding\_ruleset) | Private DNS resolver forwarding ruleset configuration | <pre>object({<br> name = string<br> })</pre> | n/a | yes |
| <a name="input_private_dns_resolver_inbound_endpoint"></a> [private\_dns\_resolver\_inbound\_endpoint](#input\_private\_dns\_resolver\_inbound\_endpoint) | Private DNS resolver inbound endpoint configuration | <pre>object({<br> name = string<br> ip_configurations = list(object({<br> private_ip_allocation_method = optional(string, "Static")<br> subnet_id = string<br> private_ip_address = optional(string, null)<br> }))<br> })</pre> | n/a | yes |
| <a name="input_private_dns_resolver_outbound_endpoint"></a> [private\_dns\_resolver\_outbound\_endpoint](#input\_private\_dns\_resolver\_outbound\_endpoint) | Private DNS resolver outbound endpoint configuration | <pre>object({<br> enabled = optional(bool, true)<br> name = string<br> subnet_id = string<br> })</pre> | n/a | yes |
Expand Down
8 changes: 0 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}))
}))
Expand Down

0 comments on commit 2c819d6

Please sign in to comment.