terraform-google-modules / terraform-google-sql-db

Creates a Cloud SQL database instance
https://registry.terraform.io/modules/terraform-google-modules/sql-db/google
Apache License 2.0
263 stars 422 forks source link

Add field `deletion_policy` to `google_service_networking_connection` in `modules/private_service_access` #585

Closed pwschuurman closed 1 month ago

pwschuurman commented 5 months ago

TL;DR

Add field deletion_policy variable for google_service_networking_connection in modules/private_service_access

Terraform Resources

No response

Detailed design

Deleting a Terraform plan that uses both PSC and CloudSQL results in a error when deleting:

Error: Unable to remove Service Networking Connection, err: Error waiting for Delete Service Networking Connection: Error code 9, message: Failed to delete connection; Producer services (e.g. CloudSQL, Cloud Memstore, etc.) are still using this connection.

This is the same symptom as in https://github.com/hashicorp/terraform-provider-google/issues/16275

The private_service_access module should add a deletion_policy variable that is propagated down to the google_service_networking_connection resource. This will enable successful deletion of the created resources, while the underlying Service Networking Connection is deleted in the background.



### Additional information

_No response_