-
Notifications
You must be signed in to change notification settings - Fork 434
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
Postgres instance deletion protection is not applied #342
Comments
I confirm the same behavior, Terraform 1.3, darwin_arm64 |
Also confirmed
|
Also confirmed on Terraform v1.3.5 on Terraform Cloud. version.tf is ... terraform {
required_version = ">= 0.13.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.4.0, < 5.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.4.0, < 5.0"
}
}
} |
The Terraform provider recently implemented this in the latest version, which looks like it should resolve the issue: hashicorp/terraform-provider-google#13249 |
That only provides deletion protection via terraform, it doesn't configure deletion protection in the service
|
There's two, the note is added to an earlier one; what you're reading is for
However, as mentioned in the note and in the paragraph you copied, the
I have not tested this, but it looks promising... |
Even with the terraform deletion protection enabled, it's still trying to force replace my database when trying to do a database_version upgrade. Will the new flag fix that? And how do I apply it? ETA: actually this new flag is perfect and fixed my issue, the original flag did nothing useful imho |
Can confirm that deletion_protection_enabled properly toggles deletion protection in the console with 14.0.1 |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
TL;DR
Noticed an issue where deletion protection for postgres databases is not applied. Even when you explicitly enable or disable deletion_protection, it fails to apply that change and the state refresh does not reflect the current configuration.
Expected behavior
When creating a new database, I expect deletion protection to be enabled. When I explicitly enable deletion protection in terraform configuration, I expect the configuration to match what gcloud is reporting.
Observed behavior
Regardless of the configuration in terraform, changes are not applied even though there are no errors reported. When refreshing the state, terraform returns no changes needed. When looking at the GCP console, deletion protection is not enabled. If I enable it manually, it works, however if I try to disable it in terraform, I still get the same result, "No changes". It appears that this flag may be silently failing and reports no changes needed or applied.
Terraform Configuration
Terraform Version
Additional information
No response
The text was updated successfully, but these errors were encountered: