Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions premerge/gke_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,27 @@ resource "google_storage_bucket" "object_cache_linux" {
}
}

resource "google_storage_bucket" "object_cache_linux_bazel" {
name = format("%s-object-cache-linux-bazel", var.cluster_name)
location = var.gcs_bucket_location

uniform_bucket_level_access = true
public_access_prevention = "enforced"

soft_delete_policy {
retention_duration_seconds = 0
}

lifecycle_rule {
action {
type = "Delete"
}
condition {
age = 7
}
}
}

resource "google_storage_bucket" "object_cache_windows" {
name = format("%s-object-cache-windows", var.cluster_name)
location = var.gcs_bucket_location
Expand Down Expand Up @@ -310,6 +331,19 @@ resource "google_storage_bucket_iam_binding" "linux_bucket_binding" {
]
}

resource "google_storage_bucket_iam_binding" "linux_bucket_bazel_binding" {
bucket = google_storage_bucket.object_cache_linux_bazel.name
role = "roles/storage.objectUser"
members = [
format("serviceAccount:%s", google_service_account.object_cache_linux_gsa.email),
]

depends_on = [
google_storage_bucket.object_cache_linux_bazel,
google_service_account.object_cache_linux_gsa,
]
}

resource "google_storage_bucket_iam_binding" "windows_bucket_binding" {
bucket = google_storage_bucket.object_cache_windows.name
role = "roles/storage.objectUser"
Expand Down