From 38b28b96fff88fae1106b254e508b5cf89a2c20f Mon Sep 17 00:00:00 2001 From: Yassin Kortam Date: Sat, 6 Jun 2026 13:42:35 -0700 Subject: [PATCH] fix(terraform/gcp): abandon SQL user on destroy (#29855) google_sql_user.app issues DROP ROLE on destroy, which Postgres refuses because the role owns every table the migrations job created (75 objects). The previous deletion_policy=ABANDON on google_sql_database keeps the DB intact through destroy, so the role still owns its objects. Set the same policy on the user; the instance deletion takes both the database and the role with it anyway. --- terraform/litellm/gcp/cloudsql.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/litellm/gcp/cloudsql.tf b/terraform/litellm/gcp/cloudsql.tf index 5d45721cea..c9c2d03b2d 100644 --- a/terraform/litellm/gcp/cloudsql.tf +++ b/terraform/litellm/gcp/cloudsql.tf @@ -108,6 +108,8 @@ resource "google_sql_user" "app" { name = var.db_username instance = google_sql_database_instance.writer.name password = random_password.db_password.result + + deletion_policy = "ABANDON" } resource "google_secret_manager_secret" "db_password" {