Skip to content

Commit

Permalink
Api restriction fix (#77)
Browse files Browse the repository at this point in the history
* fix input restriction bug

* fix bug with null ip restriction

Co-authored-by: Tim Miller <tim.miller@risk.lexisnexis.com>
  • Loading branch information
dutsmiller and Tim Miller committed Jul 19, 2021
1 parent 8dc42e3 commit 7995709
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ locals {

windows_nodes = (length([for v in local.node_pools : v if lower(v.os_type) == "windows"]) > 0 ? true : false)

api_server_authorized_ip_ranges = (var.api_server_authorized_ip_ranges == null ? null : values(var.api_server_authorized_ip_ranges))

invalid_node_pool_attributes = join(",", flatten([for np in values(var.node_pools) : [for k, v in np : k if !(contains(keys(var.node_pool_defaults), k))]]))
validate_node_pool_attributes = (length(local.invalid_node_pool_attributes) > 0 ?
file("ERROR: invalid node pool attribute: ${local.invalid_node_pool_attributes}") : null)
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ resource "azurerm_kubernetes_cluster" "aks" {
}
}

api_server_authorized_ip_ranges = values(var.api_server_authorized_ip_ranges)
api_server_authorized_ip_ranges = local.api_server_authorized_ip_ranges

addon_profile {
kube_dashboard {
Expand Down

0 comments on commit 7995709

Please sign in to comment.