Skip to content

Commit 0b69fd6

Browse files
[CI] Add gcs_bucket_location variable to gke_cluster module
This patch introduces a new gcs_bucket_location variable. Without this we cannot deploy the GCS buckets in the us-central1 region as the cluster is a zonal cluster in us-central1-a. Buckets have to be regional and cannot be specific to a zone, so we would get API errors when running terraform apply.
1 parent 9a959bf commit 0b69fd6

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

premerge/gke_cluster/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ resource "google_container_node_pool" "llvm_premerge_windows_2022" {
144144

145145
resource "google_storage_bucket" "object_cache_linux" {
146146
name = format("%s-object-cache-linux", var.cluster_name)
147-
location = var.region
147+
location = var.gcs_bucket_location
148148

149149
uniform_bucket_level_access = true
150150
public_access_prevention = "enforced"
151151
}
152152

153153
resource "google_storage_bucket" "object_cache_windows" {
154154
name = format("%s-object-cache-windows", var.cluster_name)
155-
location = var.region
155+
location = var.gcs_bucket_location
156156

157157
uniform_bucket_level_access = true
158158
public_access_prevention = "enforced"

premerge/gke_cluster/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ variable "region" {
88
type = string
99
}
1010

11+
variable "gcs_bucket_location" {
12+
description = "The location to use for the GCS buckets"
13+
type = string
14+
}
15+
1116
variable "linux_machine_type" {
1217
description = "The type of machine to use for Linux instances"
1318
type = string

premerge/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module "premerge_cluster_us_central" {
5050
libcxx_machine_type = "n2d-standard-32"
5151
linux_machine_type = "n2-standard-64"
5252
windows_machine_type = "n2-standard-32"
53+
gcs_bucket_location = "us-central1"
5354
}
5455

5556
# We explicitly specify a single zone for the service node pool locations as
@@ -64,6 +65,7 @@ module "premerge_cluster_us_west" {
6465
linux_machine_type = "n2d-standard-64"
6566
windows_machine_type = "n2d-standard-32"
6667
service_node_pool_locations = ["us-west1-a"]
68+
gcs_bucket_location = "us-west1"
6769
}
6870

6971
provider "helm" {

0 commit comments

Comments
 (0)