@@ -49,8 +49,8 @@ module "talos_worker_group" {
49
49
resource "talos_machine_secrets" "this" {}
50
50
51
51
data "talos_machine_configuration" "controlplane" {
52
- count = var. controlplane_count
53
-
52
+ for_each = { for index in range ( 0 , var. controlplane_count ) : index => index }
53
+
54
54
cluster_name = var. cluster_name
55
55
cluster_endpoint = " https://${ module . elb_k8s_elb . elb_dns_name } "
56
56
machine_type = " controlplane"
@@ -66,7 +66,7 @@ data "talos_machine_configuration" "controlplane" {
66
66
machine = {
67
67
kubelet = {
68
68
extraArgs = {
69
- hostname-override = module.talos_control_plane_nodes[count.index ].id
69
+ hostname-override = module.talos_control_plane_nodes[each.key ].id
70
70
}
71
71
}
72
72
}
@@ -109,7 +109,6 @@ data "talos_machine_configuration" "worker_group" {
109
109
110
110
resource "talos_machine_configuration_apply" "controlplane" {
111
111
count = var. controlplane_count
112
-
113
112
client_configuration = talos_machine_secrets. this . client_configuration
114
113
machine_configuration_input = data. talos_machine_configuration . controlplane [count . index ]. machine_configuration
115
114
endpoint = module. talos_control_plane_nodes [count . index ]. public_ip
@@ -136,7 +135,6 @@ resource "talos_machine_bootstrap" "this" {
136
135
data "talos_client_configuration" "this" {
137
136
cluster_name = var. cluster_name
138
137
client_configuration = talos_machine_secrets. this . client_configuration
139
- endpoints = module. talos_control_plane_nodes . * . public_ip
140
138
}
141
139
142
140
resource "local_file" "talosconfig" {
0 commit comments