resource "scaleway_ip" "k8s_node_ips" { count = "${var.node_count}" } resource "scaleway_server" "k8s_node" { name = "k8s-node${count.index}" image = "${data.scaleway_image.debian.id}" type = "${var.k8s_master_server_type}" public_ip = "${element(scaleway_ip.k8s_node_ips.*.ip, count.index)}" count = var.node_count tags = ["k8s", "k8s-node"] depends_on = [ scaleway_ssh_key.trygvis_arius-v4, scaleway_ssh_key.trygvis_birgitte, scaleway_ssh_key.trygvis_akili, scaleway_ssh_key.trygvis_conflatorio, ] } output "k8s_node_names" { value = scaleway_server.k8s_node.*.name } output "k8s_node_public_ips" { value = scaleway_server.k8s_node.*.public_ip } output "k8s_node_private_ips" { value = scaleway_server.k8s_node.*.private_ip }