Skip to content

Commit 8098489

Browse files
authored
fix: node pool creation should depend on necessary firewall rules (#2245)
1 parent 9ad4082 commit 8098489

File tree

8 files changed

+55
-10
lines changed

8 files changed

+55
-10
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,9 +1153,12 @@ resource "google_container_node_pool" "windows_pools" {
11531153
delete = lookup(var.timeouts, "delete", "45m")
11541154
}
11551155

1156-
{% if i == 1 %}
1157-
depends_on = [google_container_node_pool.pools[0]]
1158-
{% endif %}
1156+
depends_on = [
1157+
google_compute_firewall.intra_egress,
1158+
{% if i == 1 %}
1159+
google_container_node_pool.pools[0],
1160+
{% endif %}
1161+
]
11591162
}
11601163
{% endfor %}
11611164
{% endif %}

cluster.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,9 @@ resource "google_container_node_pool" "pools" {
845845
delete = lookup(var.timeouts, "delete", "45m")
846846
}
847847

848+
depends_on = [
849+
google_compute_firewall.intra_egress,
850+
]
848851
}
849852
resource "google_container_node_pool" "windows_pools" {
850853
provider = google
@@ -1127,5 +1130,8 @@ resource "google_container_node_pool" "windows_pools" {
11271130
delete = lookup(var.timeouts, "delete", "45m")
11281131
}
11291132

1130-
depends_on = [google_container_node_pool.pools[0]]
1133+
depends_on = [
1134+
google_compute_firewall.intra_egress,
1135+
google_container_node_pool.pools[0],
1136+
]
11311137
}

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,9 @@ resource "google_container_node_pool" "pools" {
10161016
delete = lookup(var.timeouts, "delete", "45m")
10171017
}
10181018

1019+
depends_on = [
1020+
google_compute_firewall.intra_egress,
1021+
]
10191022
}
10201023
resource "google_container_node_pool" "windows_pools" {
10211024
provider = google-beta
@@ -1312,5 +1315,8 @@ resource "google_container_node_pool" "windows_pools" {
13121315
delete = lookup(var.timeouts, "delete", "45m")
13131316
}
13141317

1315-
depends_on = [google_container_node_pool.pools[0]]
1318+
depends_on = [
1319+
google_compute_firewall.intra_egress,
1320+
google_container_node_pool.pools[0],
1321+
]
13161322
}

modules/beta-private-cluster/cluster.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,9 @@ resource "google_container_node_pool" "pools" {
934934
delete = lookup(var.timeouts, "delete", "45m")
935935
}
936936

937+
depends_on = [
938+
google_compute_firewall.intra_egress,
939+
]
937940
}
938941
resource "google_container_node_pool" "windows_pools" {
939942
provider = google-beta
@@ -1229,5 +1232,8 @@ resource "google_container_node_pool" "windows_pools" {
12291232
delete = lookup(var.timeouts, "delete", "45m")
12301233
}
12311234

1232-
depends_on = [google_container_node_pool.pools[0]]
1235+
depends_on = [
1236+
google_compute_firewall.intra_egress,
1237+
google_container_node_pool.pools[0],
1238+
]
12331239
}

modules/beta-public-cluster-update-variant/cluster.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,9 @@ resource "google_container_node_pool" "pools" {
986986
delete = lookup(var.timeouts, "delete", "45m")
987987
}
988988

989+
depends_on = [
990+
google_compute_firewall.intra_egress,
991+
]
989992
}
990993
resource "google_container_node_pool" "windows_pools" {
991994
provider = google-beta
@@ -1282,5 +1285,8 @@ resource "google_container_node_pool" "windows_pools" {
12821285
delete = lookup(var.timeouts, "delete", "45m")
12831286
}
12841287

1285-
depends_on = [google_container_node_pool.pools[0]]
1288+
depends_on = [
1289+
google_compute_firewall.intra_egress,
1290+
google_container_node_pool.pools[0],
1291+
]
12861292
}

modules/beta-public-cluster/cluster.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,9 @@ resource "google_container_node_pool" "pools" {
904904
delete = lookup(var.timeouts, "delete", "45m")
905905
}
906906

907+
depends_on = [
908+
google_compute_firewall.intra_egress,
909+
]
907910
}
908911
resource "google_container_node_pool" "windows_pools" {
909912
provider = google-beta
@@ -1199,5 +1202,8 @@ resource "google_container_node_pool" "windows_pools" {
11991202
delete = lookup(var.timeouts, "delete", "45m")
12001203
}
12011204

1202-
depends_on = [google_container_node_pool.pools[0]]
1205+
depends_on = [
1206+
google_compute_firewall.intra_egress,
1207+
google_container_node_pool.pools[0],
1208+
]
12031209
}

modules/private-cluster-update-variant/cluster.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,9 @@ resource "google_container_node_pool" "pools" {
956956
delete = lookup(var.timeouts, "delete", "45m")
957957
}
958958

959+
depends_on = [
960+
google_compute_firewall.intra_egress,
961+
]
959962
}
960963
resource "google_container_node_pool" "windows_pools" {
961964
provider = google
@@ -1239,5 +1242,8 @@ resource "google_container_node_pool" "windows_pools" {
12391242
delete = lookup(var.timeouts, "delete", "45m")
12401243
}
12411244

1242-
depends_on = [google_container_node_pool.pools[0]]
1245+
depends_on = [
1246+
google_compute_firewall.intra_egress,
1247+
google_container_node_pool.pools[0],
1248+
]
12431249
}

modules/private-cluster/cluster.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,9 @@ resource "google_container_node_pool" "pools" {
875875
delete = lookup(var.timeouts, "delete", "45m")
876876
}
877877

878+
depends_on = [
879+
google_compute_firewall.intra_egress,
880+
]
878881
}
879882
resource "google_container_node_pool" "windows_pools" {
880883
provider = google
@@ -1157,5 +1160,8 @@ resource "google_container_node_pool" "windows_pools" {
11571160
delete = lookup(var.timeouts, "delete", "45m")
11581161
}
11591162

1160-
depends_on = [google_container_node_pool.pools[0]]
1163+
depends_on = [
1164+
google_compute_firewall.intra_egress,
1165+
google_container_node_pool.pools[0],
1166+
]
11611167
}

0 commit comments

Comments
 (0)