Skip to content

Commit

Permalink
fixed public ips for empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
maxi418 committed Nov 30, 2023
1 parent 68bb462 commit cb399e1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/ionos-k8s-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ resource "ionoscloud_k8s_node_pool" "nodepool_scaling" {
cores_count = each.value.core_count
ram_size = each.value.ram_size
storage_size = each.value.storage_size
public_ips = each.value.create_public_ip_pools == true ? ionoscloud_ipblock.ippools[each.key].ips : slice(each.value.public_ips[each.value.nodepool_index], 0, each.value.max_node_count+1)

public_ips = each.value.create_public_ip_pools == true ? ionoscloud_ipblock.ippools[each.key].ips : (each.value.max_node_count > length(each.value.public_ips) ? null : slice(each.value.public_ips[each.value.nodepool_index], 0, each.value.max_node_count+1))

auto_scaling {
min_node_count = each.value.min_node_count
Expand Down

0 comments on commit cb399e1

Please sign in to comment.