Skip to content
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

Incompatible change: SQL database deletion policy #13206

Closed

Comments

@jochenehret
Copy link

Terraform Version

Terraform v1.3.6 / registry.terraform.io/hashicorp/google v4.45.0

Affected Resource(s)

google_sql_database

Terraform Configuration Files

resource "google_sql_database" "ccdb" {
  name      = "ccdb"
  instance  = var.cf_db_name
}

Debug Output

(not necessary for this issue)

Panic Output

(no panic)

Expected Behavior

The database is deleted.

Actual Behavior

The database is just abandoned (not deleted).

Steps to Reproduce

  1. terraform apply
  2. terraform destroy

Important Factoids

N/A

References

This is likely caused by #13107. The PR introduces a deletion policy which is set to "ABANDON" as default. This changes the default behaviour, as "ABANDON" does not really delete databases. We had to explicitly specify another deletion policy to restore the previous behaviour:

resource "google_sql_database" "ccdb" {
  name      = "ccdb"
  instance  = var.cf_db_name
  deletion_policy = "DELETE"
}

This should be clearly documented as breaking change so that users can update their Terraform resources.

@rileykarson
Copy link
Collaborator

rileykarson commented Dec 9, 2022

This shouldn't be the default behaviour- I've confirmed it was unintentional with the reviewer of the change. I'll make the change to the default, setting it back to delete. This will have impact on users roughly equivalent to a breaking change, but is correcting a bug/regression so it'll be done with a minor version rather than a major one.

modular-magician added a commit to modular-magician/terraform-provider-google-beta that referenced this issue Dec 12, 2022
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Dec 12, 2022
modular-magician added a commit to hashicorp/terraform-provider-google-beta that referenced this issue Dec 12, 2022
…6936) (#4972)

Fixes hashicorp/terraform-provider-google#13206

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit that referenced this issue Dec 12, 2022
…6936) (#13226)

Fixes #13206

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.