forseti-security / terraform-google-forseti

A Terraform module for installing Forseti on GCP
Apache License 2.0
132 stars 127 forks source link

Allow Cloud SQL deletion #616

Closed e-koma closed 3 years ago

e-koma commented 3 years ago

What Pull Reqeust

parameterized Cloud SQL's deletion_protection.

Why

Cloud SQL( google_sql_database_instance ) is default deletion_protection = "true", which makes it impossible to destroy terraform. I actually encountered the following situations.

  1. terraform apply fails when Cloud SQL's destructive parameters are set.
  2. In the situation like forseti setting did not works well(Cloud SQL starts, but GKE does not start well), I want to delete Cloud SQL, but cannot delete it.
  3. even if we want to run forseti as a trial, but after trying, we cannot delete Cloud SQL.
google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

e-koma commented 3 years ago

@googlebot I signed it!

e-koma commented 3 years ago

I now understand this issue cause terraform-provider-google version is above 3.44 in my local environment.

deletion_protection option is set by default true after google provider version 3.44, and cannot delete it. https://github.com/hashicorp/terraform-provider-google/blob/master/CHANGELOG.md#3440-october-19-2020

but forseti examples google provider are below 3.44. So this issue is not relevant in the current forseti's google provider version. I'm going to rewrite my local configuration to run it.

Thank you for your patience.