Skip to content

Commit db1cb64

Browse files
committed
move cross-variable validation into a precondition check
1 parent ccf661a commit db1cb64

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,10 @@ resource "azurerm_kubernetes_cluster" "main" {
575575
condition = (var.client_id != "" && var.client_secret != "") || (var.identity_type == "SystemAssigned") || (var.identity_ids == null ? false : length(var.identity_ids) > 0)
576576
error_message = "If use identity and `UserAssigned` is set, an `identity_ids` must be set as well."
577577
}
578+
precondition {
579+
condition = var.identity_ids == null || var.client_id == ""
580+
error_message = "Cannot set both `client_id` and `identity_ids`."
581+
}
578582
precondition {
579583
condition = var.cost_analysis_enabled != true || (var.sku_tier == "Standard" || var.sku_tier == "Premium")
580584
error_message = "`sku_tier` must be either `Standard` or `Premium` when cost analysis is enabled."

0 commit comments

Comments
 (0)