Skip to content

Commit c497b41

Browse files
committed
Regenerate modules
1 parent 27d46c6 commit c497b41

File tree

7 files changed

+47
-13
lines changed

7 files changed

+47
-13
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module "gke" {
4545
]
4646
4747
node_pools_oauth_scopes = {
48-
all = []
48+
all = []
4949
5050
default-node-pool = [
5151
"https://www.googleapis.com/auth/cloud-platform",
@@ -138,6 +138,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
138138
| node\_pools | List of maps containing node pools | list | `<list>` | no |
139139
| node\_pools\_labels | Map of maps containing node labels by node-pool name | map | `<map>` | no |
140140
| node\_pools\_metadata | Map of maps containing node metadata by node-pool name | map | `<map>` | no |
141+
| node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | map | `<map>` | no |
141142
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | map | `<map>` | no |
142143
| node\_pools\_taints | Map of lists containing node taints by node-pool name | map | `<map>` | no |
143144
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |

cluster_regional.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ resource "google_container_cluster" "primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
region = "${var.region}"
30-
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
29+
region = "${var.region}"
30+
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
3333
subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -93,6 +93,7 @@ resource "google_container_cluster" "primary" {
9393
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
9494
}
9595
}
96+
9697
remove_default_node_pool = "${var.remove_default_node_pool}"
9798
}
9899

@@ -132,7 +133,10 @@ resource "google_container_node_pool" "pools" {
132133
service_account = "${lookup(var.node_pools[count.index], "service_account", local.service_account)}"
133134
preemptible = "${lookup(var.node_pools[count.index], "preemptible", false)}"
134135

135-
oauth_scopes = ["${concat(var.node_pools_oauth_scopes["all"], var.node_pools_oauth_scopes[lookup(var.node_pools[count.index], "name")])}"]
136+
oauth_scopes = [
137+
"${concat(var.node_pools_oauth_scopes["all"],
138+
var.node_pools_oauth_scopes[lookup(var.node_pools[count.index], "name")])}",
139+
]
136140
}
137141

138142
lifecycle {

cluster_zonal.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ resource "google_container_cluster" "zonal_primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
zone = "${var.zones[0]}"
30-
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
29+
zone = "${var.zones[0]}"
30+
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
3333
subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -93,6 +93,7 @@ resource "google_container_cluster" "zonal_primary" {
9393
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
9494
}
9595
}
96+
9697
remove_default_node_pool = "${var.remove_default_node_pool}"
9798
}
9899

@@ -132,7 +133,10 @@ resource "google_container_node_pool" "zonal_pools" {
132133
service_account = "${lookup(var.node_pools[count.index], "service_account", local.service_account)}"
133134
preemptible = "${lookup(var.node_pools[count.index], "preemptible", false)}"
134135

135-
oauth_scopes = ["${concat(var.node_pools_oauth_scopes["all"], var.node_pools_oauth_scopes[lookup(var.node_pools[count.index], "name")])}"]
136+
oauth_scopes = [
137+
"${concat(var.node_pools_oauth_scopes["all"],
138+
var.node_pools_oauth_scopes[lookup(var.node_pools[count.index], "name")])}",
139+
]
136140
}
137141

138142
lifecycle {

modules/private-cluster/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ module "gke" {
4949
},
5050
]
5151
52+
node_pools_oauth_scopes = {
53+
all = []
54+
55+
default-node-pool = [
56+
"https://www.googleapis.com/auth/cloud-platform",
57+
]
58+
}
59+
5260
node_pools_labels = {
5361
all = {}
5462
@@ -138,6 +146,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
138146
| node\_pools | List of maps containing node pools | list | `<list>` | no |
139147
| node\_pools\_labels | Map of maps containing node labels by node-pool name | map | `<map>` | no |
140148
| node\_pools\_metadata | Map of maps containing node metadata by node-pool name | map | `<map>` | no |
149+
| node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | map | `<map>` | no |
141150
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | map | `<map>` | no |
142151
| node\_pools\_taints | Map of lists containing node taints by node-pool name | map | `<map>` | no |
143152
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |

modules/private-cluster/cluster_regional.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ resource "google_container_cluster" "primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
region = "${var.region}"
30-
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
29+
region = "${var.region}"
30+
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
3333
subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -93,11 +93,13 @@ resource "google_container_cluster" "primary" {
9393
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
9494
}
9595
}
96+
9697
private_cluster_config {
9798
enable_private_endpoint = "${var.enable_private_endpoint}"
9899
enable_private_nodes = "${var.enable_private_nodes}"
99100
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
100101
}
102+
101103
remove_default_node_pool = "${var.remove_default_node_pool}"
102104
}
103105

@@ -138,7 +140,8 @@ resource "google_container_node_pool" "pools" {
138140
preemptible = "${lookup(var.node_pools[count.index], "preemptible", false)}"
139141

140142
oauth_scopes = [
141-
"https://www.googleapis.com/auth/cloud-platform",
143+
"${concat(var.node_pools_oauth_scopes["all"],
144+
var.node_pools_oauth_scopes[lookup(var.node_pools[count.index], "name")])}",
142145
]
143146
}
144147

modules/private-cluster/cluster_zonal.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ resource "google_container_cluster" "zonal_primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
zone = "${var.zones[0]}"
30-
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
29+
zone = "${var.zones[0]}"
30+
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
3333
subnetwork = "${replace(data.google_compute_subnetwork.gke_subnetwork.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -93,11 +93,13 @@ resource "google_container_cluster" "zonal_primary" {
9393
service_account = "${lookup(var.node_pools[0], "service_account", local.service_account)}"
9494
}
9595
}
96+
9697
private_cluster_config {
9798
enable_private_endpoint = "${var.enable_private_endpoint}"
9899
enable_private_nodes = "${var.enable_private_nodes}"
99100
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
100101
}
102+
101103
remove_default_node_pool = "${var.remove_default_node_pool}"
102104
}
103105

@@ -138,7 +140,8 @@ resource "google_container_node_pool" "zonal_pools" {
138140
preemptible = "${lookup(var.node_pools[count.index], "preemptible", false)}"
139141

140142
oauth_scopes = [
141-
"https://www.googleapis.com/auth/cloud-platform",
143+
"${concat(var.node_pools_oauth_scopes["all"],
144+
var.node_pools_oauth_scopes[lookup(var.node_pools[count.index], "name")])}",
142145
]
143146
}
144147

modules/private-cluster/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ variable "node_pools_tags" {
180180
}
181181
}
182182

183+
variable "node_pools_oauth_scopes" {
184+
type = "map"
185+
description = "Map of lists containing node oauth scopes by node-pool name"
186+
187+
default = {
188+
all = ["https://www.googleapis.com/auth/cloud-platform"]
189+
default-node-pool = []
190+
}
191+
}
192+
183193
variable "stub_domains" {
184194
type = "map"
185195
description = "Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server"

0 commit comments

Comments
 (0)