Skip to content

Commit 6e65371

Browse files
committed
Backport node pools OAuth scopes to autogen
1 parent 439a1e3 commit 6e65371

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

autogen/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ module "gke" {
5454
},
5555
]
5656
57+
node_pools_oauth_scopes = {
58+
all = []
59+
60+
default-node-pool = [
61+
"https://www.googleapis.com/auth/cloud-platform",
62+
]
63+
}
64+
5765
node_pools_labels = {
5866
all = {}
5967

autogen/cluster_regional.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ resource "google_container_node_pool" "pools" {
140140
preemptible = "${lookup(var.node_pools[count.index], "preemptible", false)}"
141141

142142
oauth_scopes = [
143-
"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")])}",
144145
]
145146
}
146147

autogen/cluster_zonal.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ resource "google_container_node_pool" "zonal_pools" {
140140
preemptible = "${lookup(var.node_pools[count.index], "preemptible", false)}"
141141

142142
oauth_scopes = [
143-
"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")])}",
144145
]
145146
}
146147

autogen/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)