Skip to content

Commit fe9bbb1

Browse files
Rework comments on deletion_protection (#10767) (#18321)
[upstream:9a20da4eb1553c0d5851f4b7002ac0a49f94d701] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 1d1e329 commit fe9bbb1

10 files changed

+34
-17
lines changed

google/services/bigquery/resource_bigquery_table.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ func ResourceBigQueryTable() *schema.Resource {
12491249
Type: schema.TypeBool,
12501250
Optional: true,
12511251
Default: true,
1252-
Description: `Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail.`,
1252+
Description: `Whether Terraform will be prevented from destroying the instance. When the field is set to true or unset in Terraform state, a terraform apply or terraform destroy that would delete the table will fail. When the field is set to false, deleting the table is allowed.`,
12531253
},
12541254

12551255
// TableConstraints: [Optional] Defines the primary key and foreign keys.

google/services/bigtable/resource_bigtable_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func ResourceBigtableInstance() *schema.Resource {
184184
Type: schema.TypeBool,
185185
Optional: true,
186186
Default: true,
187-
Description: `Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail.`,
187+
Description: ` When the field is set to true or unset in Terraform state, a terraform apply or terraform destroy that would delete the instance will fail. When the field is set to false, deleting the instance is allowed.`,
188188
},
189189

190190
"labels": {

google/services/container/resource_container_cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func ResourceContainerCluster() *schema.Resource {
272272
Type: schema.TypeBool,
273273
Optional: true,
274274
Default: true,
275-
Description: `Whether or not to allow Terraform to destroy the instance. Defaults to true. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the cluster will fail.`,
275+
Description: `When the field is set to true or unset in Terraform state, a terraform apply or terraform destroy that would delete the cluster will fail. When the field is set to false, deleting the cluster is allowed.`,
276276
},
277277

278278
"addons_config": {

google/services/privateca/resource_privateca_certificate_authority.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,8 +839,10 @@ fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045
839839
Type: schema.TypeBool,
840840
Optional: true,
841841
Default: true,
842-
Description: `Whether or not to allow Terraform to destroy the CertificateAuthority. Unless this field is set to false
843-
in Terraform state, a 'terraform destroy' or 'terraform apply' that would delete the instance will fail.`,
842+
Description: `Whether Terraform will be prevented from destroying the CertificateAuthority.
843+
When the field is set to true or unset in Terraform state, a 'terraform apply'
844+
or 'terraform destroy' that would delete the CertificateAuthority will fail.
845+
When the field is set to false, deleting the CertificateAuthority is allowed.`,
844846
},
845847
"desired_state": {
846848
Type: schema.TypeString,

google/services/spanner/resource_spanner_database.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,12 @@ update the database's version_retention_period.`,
189189
Type: schema.TypeBool,
190190
Optional: true,
191191
Default: true,
192-
Description: `Whether or not to allow Terraform to destroy the database. Defaults to true. Unless this field is set to false
193-
in Terraform state, a 'terraform destroy' or 'terraform apply' that would delete the database will fail.`,
192+
Description: `Whether Terraform will be prevented from destroying the database. Defaults to true.
193+
When a'terraform destroy' or 'terraform apply' would delete the database,
194+
the command will fail if this field is not set to false in Terraform state.
195+
When the field is set to true or unset in Terraform state, a 'terraform apply'
196+
or 'terraform destroy' that would delete the database will fail.
197+
When the field is set to false, deleting the database is allowed.`,
194198
},
195199
"project": {
196200
Type: schema.TypeString,

website/docs/r/bigquery_table.html.markdown

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ The following arguments are supported:
161161
* `materialized_view` - (Optional) If specified, configures this table as a materialized view.
162162
Structure is [documented below](#nested_materialized_view).
163163

164-
* `deletion_protection` - (Optional) Whether or not to allow Terraform to destroy the instance. Unless this field is set to false
165-
in Terraform state, a `terraform destroy` or `terraform apply` that would delete the instance will fail.
164+
* `deletion_protection` - (Optional) Whether Terraform will be prevented from destroying the table.
165+
When the field is set to true or unset in Terraform state, a `terraform apply`
166+
or `terraform destroy` that would delete the table will fail.
167+
When the field is set to false, deleting the table is allowed..
166168

167169
* `table_constraints` - (Optional) Defines the primary key and foreign keys.
168170
Structure is [documented below](#nested_table_constraints).

website/docs/r/bigtable_instance.html.markdown

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ to default to the backend value. See [structure below](#nested_cluster).
9999

100100
* `force_destroy` - (Optional) Deleting a BigTable instance can be blocked if any backups are present in the instance. When `force_destroy` is set to true, Terraform will delete all backups found in the BigTable instance before attempting to delete the instance itself. Defaults to false.
101101

102-
* `deletion_protection` - (Optional) Whether or not to allow Terraform to destroy the instance. Unless this field is set to false
103-
in Terraform state, a `terraform destroy` or `terraform apply` that would delete the instance will fail. Defaults to true.
102+
* `deletion_protection` - (Optional) Whether Terraform will be prevented from destroying the instance.
103+
When the field is set to true or unset in Terraform state, a `terraform apply` or `terraform destroy` that would delete
104+
the instance will fail. When the field is set to false, deleting the instance is allowed.
104105

105106
* `labels` - (Optional) A set of key/value label pairs to assign to the resource. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.
106107

website/docs/r/privateca_certificate_authority.html.markdown

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,10 @@ The following arguments are supported:
759759
* `project` - (Optional) The ID of the project in which the resource belongs.
760760
If it is not provided, the provider project is used.
761761

762-
* `deletion_protection` - (Optional) Whether or not to allow Terraform to destroy the CertificateAuthority. Unless this field is set to false
763-
in Terraform state, a `terraform destroy` or `terraform apply` that would delete the instance will fail.
762+
* `deletion_protection` - (Optional) Whether Terraform will be prevented from destroying the CertificateAuthority.
763+
When the field is set to true or unset in Terraform state, a `terraform apply`
764+
or `terraform destroy` that would delete the CertificateAuthority will fail.
765+
When the field is set to false, deleting the CertificateAuthority is allowed.
764766

765767
* `desired_state` - (Optional) Desired state of the CertificateAuthority. Set this field to `STAGED` to create a `STAGED` root CA.
766768

website/docs/r/spanner_database.html.markdown

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ The following arguments are supported:
120120
* `project` - (Optional) The ID of the project in which the resource belongs.
121121
If it is not provided, the provider project is used.
122122

123-
* `deletion_protection` - (Optional) Whether or not to allow Terraform to destroy the database. Defaults to true. Unless this field is set to false
124-
in Terraform state, a `terraform destroy` or `terraform apply` that would delete the database will fail.
123+
* `deletion_protection` - (Optional) Whether Terraform will be prevented from destroying the database. Defaults to true.
124+
When a`terraform destroy` or `terraform apply` would delete the database,
125+
the command will fail if this field is not set to false in Terraform state.
126+
When the field is set to true or unset in Terraform state, a `terraform apply`
127+
or `terraform destroy` that would delete the database will fail.
128+
When the field is set to false, deleting the database is allowed.
125129

126130

127131
<a name="nested_encryption_config"></a>The `encryption_config` block supports:

website/docs/r/sql_database_instance.html.markdown

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,10 @@ includes an up-to-date reference of supported versions.
248248
That service account needs the `Cloud KMS > Cloud KMS CryptoKey Encrypter/Decrypter` role on your
249249
key - please see [this step](https://cloud.google.com/sql/docs/mysql/configure-cmek#grantkey).
250250

251-
* `deletion_protection` - (Optional) Whether or not to allow Terraform to destroy the instance. Unless this field is set to false
252-
in Terraform state, a `terraform destroy` or `terraform apply` command that deletes the instance will fail. Defaults to `true`.
251+
* `deletion_protection` - (Optional) Whether Terraform will be prevented from destroying the instance.
252+
When the field is set to true or unset in Terraform state, a `terraform apply`
253+
or `terraform destroy` that would delete the instance will fail.
254+
When the field is set to false, deleting the instance is allowed.
253255

254256
~> **NOTE:** This flag only protects instances from deletion within Terraform. To protect your instances from accidental deletion across all surfaces (API, gcloud, Cloud Console and Terraform), use the API flag `settings.deletion_protection_enabled`.
255257

0 commit comments

Comments
 (0)