-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add a deletion_protection field for google_sql_database_instance #7072
Please add a deletion_protection field for google_sql_database_instance #7072
Comments
@david-wb what was the plan? Was it "update in-place" or "destroy and create a new instance"? Because looks like "lifecycle { prevent_destroy = true }" is out-of-the-box solution for such cases for any resource. |
@Chupaka True, I've started using |
@Chupaka: after setting a precedent for a The difference between It also works in the case that the config for the resource is no longer present, unlike |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Description
Today a changed the
database_version
field on agoogle_sql_database_instance
resource fromto
This caused the database to be completely deleted, including the backups! Luckily this was a dev database, but there needs to be a better way to prevent this type of thing from happening.
I've considered changing the IAM role permissions under which terraform is being run so that deletion is prevented. Unfortunately, that solution isn't quite good enough. Other engineers on the project might run terraform locally and with different permissions and run into the same issue. I strongly believe both terraform-provider-google and GCP itself should provide mechanisms to prevent accidental sql instance deletion.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: