Skip to content

Commit

Permalink
refactor check expression
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Sep 10, 2024
1 parent 6b6e5ea commit b1086b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ resource "azurerm_kubernetes_cluster" "main" {
error_message = "A user assigned identity or a service principal must be used when using a custom private dns zone"
}
precondition {
condition = var.private_dns_zone_id == null ? true : (anytrue([for r in local.valid_private_dns_zone_regexs : try(regex(r, reverse(split("/", var.private_dns_zone_id))[0]) == reverse(split("/", var.private_dns_zone_id))[0], false)]))
condition = var.private_dns_zone_id == null ? true : (anytrue([for r in local.valid_private_dns_zone_regexs : try(regex(r, local.private_dns_zone_name) == local.private_dns_zone_name, false)]))
error_message = "According to the [document](https://learn.microsoft.com/en-us/azure/aks/private-clusters?tabs=azure-portal#configure-a-private-dns-zone), the private DNS zone must be in one of the following format: `privatelink.<region>.azmk8s.io`, `<subzone>.privatelink.<region>.azmk8s.io`, `private.<region>.azmk8s.io`, `<subzone>.private.<region>.azmk8s.io`"
}
}
Expand Down

0 comments on commit b1086b7

Please sign in to comment.