Skip to content

Commit

Permalink
fix: Handle per subscription AZ restrictions (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpanzella authored Oct 1, 2024
1 parent 0ae5c69 commit 997c48b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/public-dns/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ output "url" {

output "oidc_issuer_url" {
value = module.wandb.oidc_issuer_url
}
}
8 changes: 6 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ locals {
sku.name == local.kubernetes_instance_type
)
]
num_zones = var.node_pool_zones != null ? length(var.node_pool_zones) : var.node_pool_num_zones
node_pool_zones = var.node_pool_zones != null ? var.node_pool_zones : slice(sort(local.vm_skus[0].locationInfo[0].zones), 0, local.num_zones)

num_zones = var.node_pool_zones != null ? length(var.node_pool_zones) : var.node_pool_num_zones
restricted_zones = length(local.vm_skus[0].restrictions) > 0 ? local.vm_skus[0].restrictions[0].restrictionInfo.zones : []
all_zones = local.vm_skus[0].locationInfo[0].zones
valid_zones = setsubtract(local.all_zones, local.restricted_zones)
node_pool_zones = var.node_pool_zones != null ? var.node_pool_zones : slice(sort(local.valid_zones), 0, local.num_zones)
}

module "app_aks" {
Expand Down
1 change: 1 addition & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ output "client_id" {
output "tenant_id" {
value = module.identity.identity.tenant_id
}

0 comments on commit 997c48b

Please sign in to comment.