Skip to content

Commit f5e24c4

Browse files
authored
Correct documentation for disable_on_destroy default breaking change (#15014)
1 parent faa7118 commit f5e24c4

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

mmv1/third_party/terraform/website/docs/guides/version_7_upgrade.html.markdown

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,20 @@ This resource is not functional and can safely be removed from your configuratio
241241

242242
## Resource: `google_project_service`
243243

244-
### `disable_on_destroy` now defaults to `false`
244+
### `disable_on_destroy` no longer defaults to `true`
245245

246-
The default value for `disable_on_destroy` has been changed to `false`. The previous default (`true`) created a risk of unintended service disruptions, as destroying a single `google_project_service` resource would disable the API for the entire project.
246+
The default value for `disable_on_destroy` has been removed. The previous default (`true`) created a risk of unintended service disruptions, as destroying a single `google_project_service` resource would disable the API for the entire project.
247247

248-
Now, destroying the resource will only remove it from Terraform's state and leave the service enabled. To disable a service when the resource is destroyed, you must now make an explicit decision by setting `disable_on_destroy = true`.
248+
Now, destroying the resource will only remove it from Terraform's state and leave the service enabled. For resources that did not explicitly have `disable_on_destroy` set, users will see a diff similar to the following:
249+
250+
```hcl
251+
~ resource "google_project_service" "main" {
252+
- disable_on_destroy = true -> null
253+
```
254+
255+
Applying this change is the same as setting the value to `false`. Terraform will not make any additional API requests or change the project service enablement. It will only affect any future removal of this resource.
256+
257+
To enable the previous default behavior, you must now make an explicit decision by setting `disable_on_destroy = true`.
249258

250259
## Resource: `google_redis_cluster`
251260

mmv1/third_party/terraform/website/docs/r/google_project_service.html.markdown

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ The following arguments are supported:
4545
* `project` - (Optional) The project ID. If not provided, the provider project
4646
is used.
4747

48-
* `disable_on_destroy` - (Optional) If `true` or unset, disable the service when the
49-
Terraform resource is destroyed. If `false`, the service will be left enabled when
50-
the Terraform resource is destroyed. Defaults to `false`. It should generally only
48+
* `disable_on_destroy` - (Optional) If `true`, disable the service when the
49+
Terraform resource is destroyed. If `false` or unset, the service will be left enabled when
50+
the Terraform resource is destroyed. It should generally only
5151
be `true` or unset in configurations that manage the `google_project` resource itself.
5252

5353
* `disable_dependent_services` - (Optional) If `true`, services that are enabled
@@ -59,7 +59,6 @@ services depend on this service when attempting to destroy it.
5959
[Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)
6060
If `true`, the usage of the service to be disabled will be checked and an error
6161
will be returned if the service to be disabled has usage in last 30 days.
62-
Defaults to `false`.
6362

6463
## Attributes Reference
6564

0 commit comments

Comments
 (0)