Skip to content

gcp/loadbalancer/external: support Cloud CDN backend buckets for monitoring endpoints - #958

Draft
patflynn wants to merge 3 commits into
transparency-dev:mainfrom
patflynn:gcp-lb-cdn
Draft

patflynn wants to merge 3 commits into
transparency-dev:mainfrom
patflynn:gcp-lb-cdn

Conversation

@patflynn

@patflynn patflynn commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Allow each log in var.logs to opt in (enable_cdn = true) to serving Static CT monitoring endpoints (/checkpoint, /tile/*, /issuer/*) from its GCS bucket via a Cloud CDN-enabled google_compute_backend_bucket with cache_mode = "USE_ORIGIN_HEADERS".

Details & Safety

  • Opt-in per log (enable_cdn = optional(bool, false)): Defaults to false so existing load balancer deployments are completely unaffected until explicitly enabled per log/environment (e.g. static-ct-staging first, then static-ct-prod).
  • USE_ORIGIN_HEADERS cache mode: Respects GCS object Cache-Control headers (max-age=604800,immutable on tiles and entry bundles for the full 7-day TTL without clamping, public, max-age=3600 on issuers, and no-cache with conditional edge revalidation / request coalescing on /checkpoint).
  • Optional bucket_name override: Defaults to ${name}.${submission_host_suffix} (the log origin), while allowing logs with non-domain bucket names (such as legacy arche* staging logs) to specify an explicit bucket_name.
  • Zero SSL certificate churn: Scopes random_id.suffix keepers.logs to region and submission_host_suffix so adding optional fields to var.logs or toggling enable_cdn never triggers managed SSL certificate replacement.

…toring endpoints

Allow each log in var.logs to opt in (enable_cdn = true) to serving
Static CT monitoring endpoints (/checkpoint, /tile/*, /issuer/*) from
its GCS bucket via a Cloud CDN-enabled google_compute_backend_bucket
with cache_mode = "USE_ORIGIN_HEADERS".

- Defaults enable_cdn to false so existing deployments are unaffected
  until explicitly enabled per log/environment.
- Supports optional bucket_name override when a log's GCS bucket name
  differs from <name>.<submission_host_suffix>.
- Scopes random_id.suffix keepers to region and submission_host_suffix
  so adding optional fields to var.logs does not trigger managed SSL
  certificate replacement.
@patflynn
patflynn requested a review from a team as a code owner October 7, 2026 16:49
@patflynn
patflynn requested review from mhutchinson and removed request for a team and mhutchinson October 7, 2026 16:49
@patflynn
patflynn marked this pull request as draft October 7, 2026 17:01
…uckets

The Google provider sends requestCoalescing=false when the field is
unset, which turns off Cloud CDN's default of collapsing concurrent
cache fills for the same object.
Without create_before_destroy, turning enable_cdn off fails: OpenTofu
deletes the backend bucket before it updates the URL map, and GCP
rejects the delete while the URL map still references it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant