terraform-provider-google: Need `abandon_on_delete` behavior for SQL User due to bug in GCP postgres delete behavior.
Hello I am having an issue. I’m setting up a gcp cloud sql instance. I reset the postgres user password, but when destroying the infra, it tries to delete the postgres user. Error: Error, failed to deleteuser postgres in instance clair-indexer-main-8be49086:
resource "google_sql_database_instance" "indexer" {
name = "clair-indexer-${local.clair_suffix}"
database_version = "POSTGRES_11"
deletion_protection = false
depends_on = [google_service_networking_connection.private_vpc_connection]
settings {
tier = "db-g1-small"
disk_autoresize = true
ip_configuration {
private_network = data.google_compute_network.default.id
}
}
}
resource "google_sql_user" "indexer" {
name = "postgres"
instance = google_sql_database_instance.indexer.name
password = "clair"
}
(password is not sensitive, this is throw away) can i tell terraform to not even try to delete that sql user? it’ll be deleted on its own when the database instance is removed.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 27 (5 by maintainers)
All right - we will go ahead and plan to implement that solution. We’ll triage this at our meeting next Monday, I expect that it will be prioritized, and we will have this to you as soon as we can.
This worked great.
thanks for the quick turn around on this solution!