Closed davidkarlsen closed 1 year ago
Thank you for reporting this @davidkarlsen... we didn't observe this during testing but will see whether we can reproduce.
As part of the 3.x
releases we have made a number of updates to the DNS zones managed by the module. I notice you are specifying the duplicate key privatelink.norwayeast.kusto.windows.net
in private_dns_zones
.
Does this error still occur if you remove this from your config?
We automatically de-duplicate the managed zones, but not user-specified ones. We can certainly consider adding this capability.
@krowlandson It's in the list because we want the private zone for this service too, I guess it will be dropped if I remove it. I tried that, but now it fails on:
2022-12-29T22:19:51.3784137Z Error: Not enough list items
2022-12-29T22:19:51.3784329Z
2022-12-29T22:19:51.3785843Z with module.caf-enterprise-scale.azurerm_virtual_network_gateway.connectivity["/subscriptions/***/resourceGroups/es-connectivity-norwayeast/providers/Microsoft.Network/virtualNetworkGateways/es-vpngw-norwayeast"],
2022-12-29T22:19:51.3786796Z on .terraform/modules/caf-enterprise-scale/resources.connectivity.tf line 138, in resource "azurerm_virtual_network_gateway" "connectivity":
2022-12-29T22:19:51.3787298Z 138: resource "azurerm_virtual_network_gateway" "connectivity" {
2022-12-29T22:19:51.3787508Z
2022-12-29T22:19:51.3787726Z Attribute bgp_settings.0.peering_addresses.0.apipa_addresses requires 1 item
2022-12-29T22:19:51.3788092Z minimum, but config has only 0 declared.
2022-12-29T22:19:51.3837137Z
2022-12-29T22:19:51.3837695Z Error: Not enough list items
2022-12-29T22:19:51.3838112Z
2022-12-29T22:19:51.3840354Z with module.caf-enterprise-scale.azurerm_virtual_network_gateway.connectivity["/subscriptions/***/resourceGroups/es-connectivity-norwayeast/providers/Microsoft.Network/virtualNetworkGateways/es-vpngw-norwayeast"],
2022-12-29T22:19:51.3844029Z on .terraform/modules/caf-enterprise-scale/resources.connectivity.tf line 138, in resource "azurerm_virtual_network_gateway" "connectivity":
2022-12-29T22:19:51.3845023Z 138: resource "azurerm_virtual_network_gateway" "connectivity" {
2022-12-29T22:19:51.3845274Z
2022-12-29T22:19:51.3845504Z Attribute bgp_settings.0.peering_addresses.1.apipa_addresses requires 1 item
2022-12-29T22:19:51.3845879Z minimum, but config has only 0 declared.
2022-12-29T22:19:51.7841852Z Releasing state lock. This may take a few moments...
2022-12-29T22:19:51.9473425Z ##[error]Terraform exited with code 1.
2022-12-29T22:19:51.9486131Z ##[error]Process completed with exit code 1.
but we don't use apipa addresses.
Thank you for providing the above @davidkarlsen.
The regional Kusto DNS zone is now created by the module (by default) which is why you no longer need that entry. It shouldn't effect your configuration, but it might also be worth reviewing the other zones we have added.
Regarding the new error above, I will look into this as this is likely caused by the new optional()
defaults. Let me see if I can find the cause.
Hi @davidkarlsen, please can you test with release v3.1.2 and let me know if you run into any further issues?
The regional Kusto DNS zone is now created by the module (by default) which is why you no longer need that entry. It shouldn't effect your configuration, but it might also be worth reviewing the other zones we have added.
aha, I was under the impression that it was opt-in, and you had to enable via the enable_private_link_by_service
element.
Regarding the new error above, I will look into this as this is likely caused by the new
optional()
defaults. Let me see if I can find the cause.
I'll see what happens if I drop them, not having to define the elements at all is the most clean seen from a user-perspective.
So I ended up with this diff which worked fine:
diff --git a/main.tf b/main.tf
index f39e814..78a8570 100644
--- a/main.tf
+++ b/main.tf
@@ -8,7 +8,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
- version = "~> 3.7, < 3.19"
+ version = "~> 3.37"
}
cloudflare = {
source = "cloudflare/cloudflare"
@@ -55,7 +55,7 @@ data "azurerm_client_config" "core" {}
module "caf-enterprise-scale" {
source = "Azure/caf-enterprise-scale/azurerm"
- version = "2.4.1"
+ version = "3.1.2"
providers = {
azurerm = azurerm
azurerm.connectivity = azurerm
@@ -163,8 +163,8 @@ module "caf-enterprise-scale" {
asn = var.az_bgp_asn
peer_weight = 32768
peering_addresses = [
- { ip_configuration_name = "vnetGatewayConfig1", apipa_addresses = null },
- { ip_configuration_name = "vnetGatewayConfig2", apipa_addresses = null }
+ { ip_configuration_name = "vnetGatewayConfig1" },
+ { ip_configuration_name = "vnetGatewayConfig2" }
]
}]
vpn_client_configuration = [{
@@ -265,7 +265,7 @@ module "caf-enterprise-scale" {
}
private_link_locations = []
public_dns_zones = ["dev.az.finods.com"]
- private_dns_zones = ["appserviceenvironment.net", "privatelink.norwayeast.kusto.windows.net"]
+ private_dns_zones = ["appserviceenvironment.net"]
enable_private_dns_zone_virtual_network_link_on_hubs = true
enable_private_dns_zone_virtual_network_link_on_spokes = true
}
Thanks a lot for your help and have a happy new year!
That's great, thank you for confirming @davidkarlsen ππ»
Community Note
Versions
terraform:
azure provider: 3.37
module: 3.1.1
Description
fails on "produces duplicate key"
Describe the bug
config:
Steps to Reproduce
Upgrade from 2.4.1 to 3.1.1
Screenshots
See bug-report.
Additional context