Skip to content

Commit

Permalink
Rework comments on deletion_protection (#10767) (#18321)
Browse files Browse the repository at this point in the history
[upstream:9a20da4eb1553c0d5851f4b7002ac0a49f94d701]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jun 4, 2024
1 parent 1d1e329 commit fe9bbb1
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 17 deletions.
2 changes: 1 addition & 1 deletion google/services/bigquery/resource_bigquery_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ func ResourceBigQueryTable() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
Default: true,
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.`,
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.`,
},

// TableConstraints: [Optional] Defines the primary key and foreign keys.
Expand Down
2 changes: 1 addition & 1 deletion google/services/bigtable/resource_bigtable_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func ResourceBigtableInstance() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
Default: true,
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.`,
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.`,
},

"labels": {
Expand Down
2 changes: 1 addition & 1 deletion google/services/container/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func ResourceContainerCluster() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
Default: true,
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.`,
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.`,
},

"addons_config": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,10 @@ fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045
Type: schema.TypeBool,
Optional: true,
Default: true,
Description: `Whether or not to allow Terraform to destroy the CertificateAuthority. Unless this field is set to false
in Terraform state, a 'terraform destroy' or 'terraform apply' that would delete the instance will fail.`,
Description: `Whether Terraform will be prevented from destroying the CertificateAuthority.
When the field is set to true or unset in Terraform state, a 'terraform apply'
or 'terraform destroy' that would delete the CertificateAuthority will fail.
When the field is set to false, deleting the CertificateAuthority is allowed.`,
},
"desired_state": {
Type: schema.TypeString,
Expand Down
8 changes: 6 additions & 2 deletions google/services/spanner/resource_spanner_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ update the database's version_retention_period.`,
Type: schema.TypeBool,
Optional: true,
Default: true,
Description: `Whether or not to allow Terraform to destroy the database. Defaults to true. Unless this field is set to false
in Terraform state, a 'terraform destroy' or 'terraform apply' that would delete the database will fail.`,
Description: `Whether Terraform will be prevented from destroying the database. Defaults to true.
When a'terraform destroy' or 'terraform apply' would delete the database,
the command will fail if this field is not set to false in Terraform state.
When the field is set to true or unset in Terraform state, a 'terraform apply'
or 'terraform destroy' that would delete the database will fail.
When the field is set to false, deleting the database is allowed.`,
},
"project": {
Type: schema.TypeString,
Expand Down
6 changes: 4 additions & 2 deletions website/docs/r/bigquery_table.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ The following arguments are supported:
* `materialized_view` - (Optional) If specified, configures this table as a materialized view.
Structure is [documented below](#nested_materialized_view).

* `deletion_protection` - (Optional) 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.
* `deletion_protection` - (Optional) Whether Terraform will be prevented from destroying the table.
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..

* `table_constraints` - (Optional) Defines the primary key and foreign keys.
Structure is [documented below](#nested_table_constraints).
Expand Down
5 changes: 3 additions & 2 deletions website/docs/r/bigtable_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ to default to the backend value. See [structure below](#nested_cluster).

* `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.

* `deletion_protection` - (Optional) 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. Defaults to true.
* `deletion_protection` - (Optional) 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 instance will fail. When the field is set to false, deleting the instance is allowed.

* `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.

Expand Down
6 changes: 4 additions & 2 deletions website/docs/r/privateca_certificate_authority.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,10 @@ The following arguments are supported:
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.

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

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

Expand Down
8 changes: 6 additions & 2 deletions website/docs/r/spanner_database.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ The following arguments are supported:
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.

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


<a name="nested_encryption_config"></a>The `encryption_config` block supports:
Expand Down
6 changes: 4 additions & 2 deletions website/docs/r/sql_database_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,10 @@ includes an up-to-date reference of supported versions.
That service account needs the `Cloud KMS > Cloud KMS CryptoKey Encrypter/Decrypter` role on your
key - please see [this step](https://cloud.google.com/sql/docs/mysql/configure-cmek#grantkey).

* `deletion_protection` - (Optional) 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` command that deletes the instance will fail. Defaults to `true`.
* `deletion_protection` - (Optional) 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 instance will fail.
When the field is set to false, deleting the instance is allowed.

~> **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`.

Expand Down

0 comments on commit fe9bbb1

Please sign in to comment.