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.
This commit is contained in:
parent
43c10370ee
commit
38b28b96ff
@ -108,6 +108,8 @@ resource "google_sql_user" "app" {
|
|||||||
name = var.db_username
|
name = var.db_username
|
||||||
instance = google_sql_database_instance.writer.name
|
instance = google_sql_database_instance.writer.name
|
||||||
password = random_password.db_password.result
|
password = random_password.db_password.result
|
||||||
|
|
||||||
|
deletion_policy = "ABANDON"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "google_secret_manager_secret" "db_password" {
|
resource "google_secret_manager_secret" "db_password" {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user