Azure/terraform-azurerm-caf-enterprise-scale

Bug Report: Private DNS zone link in setting.connectivity.tf

tisigoncalve opened this issue ยท 1 comments

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Versions

terraform: 1.0.10

azure provider: 2.82.0

module: 1.0

Description

In setting.connectivity.tf file the Private DNS zone are linked to the VNET's even when the bellow boolean's were false. this happens for the hub vnet and for the spoke vnet

      enable_private_dns_zone_virtual_network_link_on_hubs   = false
      enable_private_dns_zone_virtual_network_link_on_spokes = false

Steps to Reproduce

  1. Create hub vnet and attach the spoke vnet (spoke_virtual_network_resource_ids) in the setting.connectivity.tf

  2. put the following values to false:
    enable_private_dns_zone_virtual_network_link_on_hubs = false
    enable_private_dns_zone_virtual_network_link_on_spokes = false

  3. in the TF plan the link between VNET and private DNS zone is created.

Looks like the root cause of this was down to selecting the wrong scope when determining whether these resources should be managed_by_module.

We were pulling the managed_by_module value from the underlying azurerm_private_dns_zone configuration and not considering the individual azurerm_private_dns_zone_virtual_network_link configuration.

Have updated the code to consider both as part of determining whether to create the azurerm_private_dns_zone_virtual_network_link resource or not.