From af78d18b5c0f3fb8c5de065265b0c919b543323a Mon Sep 17 00:00:00 2001 From: jakeross Date: Tue, 18 Aug 2026 20:38:57 -0700 Subject: [PATCH] chore(ingestion): put the raw zone in us-west4, beside Cloud SQL The buckets were created in US-CENTRAL1 from a default chosen before the database region was known. The dataservices instance is in us-west4, so every Mode B replay would have read across regions and paid egress to reach the loader. Bucket location is immutable, so applying this replaces both buckets. Verified empty first -- zero objects in each -- which makes now the only cheap moment to do it. After a backfill has landed, moving regions means copying objects and re-pointing the pipeline rather than editing a variable, which the comment on the resource now says. Co-Authored-By: Claude Opus 5 --- automated_ingestion/iac/.terraform.tfstate.lock.info | 1 + automated_ingestion/iac/main.tf | 9 +++++++-- automated_ingestion/iac/variables.tf | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 automated_ingestion/iac/.terraform.tfstate.lock.info diff --git a/automated_ingestion/iac/.terraform.tfstate.lock.info b/automated_ingestion/iac/.terraform.tfstate.lock.info new file mode 100644 index 000000000..b3e86bd78 --- /dev/null +++ b/automated_ingestion/iac/.terraform.tfstate.lock.info @@ -0,0 +1 @@ +{"ID":"dbce0c93-cc58-cb45-fa55-faf792ad5025","Operation":"OperationTypeApply","Info":"","Who":"jakeross@Jakes-MacBook-Pro.local","Version":"1.14.8","Created":"2026-08-19T03:37:52.057173Z","Path":"terraform.tfstate"} \ No newline at end of file diff --git a/automated_ingestion/iac/main.tf b/automated_ingestion/iac/main.tf index e432f1808..47bd0dac3 100644 --- a/automated_ingestion/iac/main.tf +++ b/automated_ingestion/iac/main.tf @@ -30,8 +30,13 @@ locals { resource "google_storage_bucket" "ingestion_raw" { for_each = local.environments - name = "ocotillo-ingestion-${each.key}" - project = var.project_id + name = "ocotillo-ingestion-${each.key}" + project = var.project_id + + # Bucket location is immutable: changing it replaces the bucket. That is + # tolerable only while the raw zone is empty. Once a backfill has landed, + # moving regions means copying objects across and re-pointing the pipeline, + # not editing this line. location = var.bucket_location # The raw zone is the replay source for Mode B backfill: reprocessing a diff --git a/automated_ingestion/iac/variables.tf b/automated_ingestion/iac/variables.tf index d7440af8c..2fae9003a 100644 --- a/automated_ingestion/iac/variables.tf +++ b/automated_ingestion/iac/variables.tf @@ -11,8 +11,8 @@ variable "region" { variable "bucket_location" { type = string - description = "Bucket location. US-CENTRAL1 keeps the raw zone in the same region as Cloud SQL, so replay reads do not cross regions." - default = "US-CENTRAL1" + description = "Bucket location. Must match the Cloud SQL region so replay reads do not cross regions and pay egress. The dataservices instance is in us-west4." + default = "US-WEST4" } variable "cloud_sql_instance" {