Add cross project support for backend bucket (#3273)

* Added cross project support for backend bucket.

* Ran terraform fmt.

* Ran tfdoc.

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
norbert-loderer
2025-08-14 07:08:54 +00:00
committed by GitHub
parent a106688b0e
commit 634c06e5a1
3 changed files with 19 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@@ -17,8 +17,12 @@
# tfdoc:file:description Backend groups and backend buckets resources.
resource "google_compute_backend_bucket" "default" {
for_each = var.backend_buckets_config
project = var.project_id
for_each = var.backend_buckets_config
project = (
each.value.project_id == null
? var.project_id
: each.value.project_id
)
name = "${var.name}-${each.key}"
bucket_name = each.value.bucket_name
compression_mode = each.value.compression_mode

View File

@@ -23,6 +23,7 @@ variable "backend_buckets_config" {
description = optional(string)
edge_security_policy = optional(string)
enable_cdn = optional(bool)
project_id = optional(string)
cdn_policy = optional(object({
bypass_cache_on_request_headers = optional(list(string))
cache_mode = optional(string)