Skip to content

Commit 5d9b9e0

Browse files
committed
added info to other versions
1 parent 0e9d319 commit 5d9b9e0

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

content/terraform/v1.12.x/docs/language/block/resource.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ resource {
315315
You can specify the following lifecycle rules to manage how Terraform performs operations on the resource:
316316

317317
- [`create_before_destroy`](#create_before_destroy): Terraform creates a replacement resource before destroying the current resource.
318-
- [`prevent_destroy`](#prevent_destroy): Terraform rejects operations to destroy the resource and returns an error.
318+
- [`prevent_destroy`](#prevent_destroy): Terraform rejects operations to destroy the resource and returns an error. This rule doesn't prevent Terraform from destroying the resource if you remove the resource configuration. For instructions on how to remove a resource from state without destroying the actual resource, refer to [Remove a resource from state](/terraform/language/state/remove).
319319
- [`ignore_changes`](#ignore_changes): Specifies a list of resource attributes that Terraform ignores changes to. Otherwise, Terraform attempts to update the actual resource to match the configuration.
320320
- [`replace_triggered_by`](#replace-triggered_by): Terraform replaces the resource when any of the referenced resources or specified attributes change.
321321
- [`precondition`](#precondition): Specifies a condition that Terraform evaluates before creating the resource. Refer to [Validate your configuration](/terraform/language/validate) for more information.
@@ -369,7 +369,9 @@ resource {
369369

370370
Use this argument to prevent team members from accidentally replacing critical infrastructure, such as database instances.
371371

372-
When the `prevent_destroy` argument is set, you must either remove the resource from the configuration or change the `prevent_destroy` argument to `false` to destroy it. Use this argument with caution. The `prevent_destroy` argument can make applying resource changes or destroying resources more complex.
372+
When `prevent_destroy` is enabled, you must either remove the resource from the configuration or change the `prevent_destroy` argument to `false` to destroy it. Use this argument with caution. The `prevent_destroy` argument can make applying resource changes or destroying resources more complex.
373+
374+
This rule doesn't prevent Terraform from destroying the resource if you remove the resource configuration. For instructions on how to remove a resource from state without destroying the actual resource, refer to [Remove a resource from state](/terraform/language/state/remove).
373375

374376
#### Summary
375377

content/terraform/v1.12.x/docs/language/meta-arguments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ The `lifecycle` block accepts a rule that customizes how Terraform performs the
180180
| Rule | Description | Terraform block |
181181
| --- | --- | --- |
182182
| `create_before_destroy` | Terraform creates a replacement resource before destroying the current resource. | `resource` |
183-
| `prevent_destroy` | Terraform rejects operations to destroy the resource and returns an error. | `resource` |
183+
| `prevent_destroy` | Terraform rejects operations to destroy the resource and returns an error. This rule doesn't prevent Terraform from destroying the resource if you remove the resource configuration. For instructions on how to remove a resource from state without destroying the actual resource, refer to [Remove a resource from state](/terraform/language/state/remove). | `resource` |
184184
| `ignore_changes` | Specifies a list of resource attributes that Terraform ignores changes to. Otherwise, Terraform attempts to update the actual resource to match the configuration. | `resource` |
185185
| `replace_triggered_by` | Terraform replaces the resource when any of the referenced resources or specified attributes change. | `resource` |
186186
| `precondition` | Specifies a condition that Terraform evaluates before creating the resource. | `data`, `ephemeral`, `resource` |

content/terraform/v1.13.x/docs/language/block/resource.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ resource {
321321
You can specify the following lifecycle rules to manage how Terraform performs operations on the resource:
322322

323323
- [`create_before_destroy`](#create_before_destroy): Terraform creates a replacement resource before destroying the current resource.
324-
- [`prevent_destroy`](#prevent_destroy): Terraform rejects operations to destroy the resource and returns an error.
324+
- [`prevent_destroy`](#prevent_destroy): Terraform rejects operations to destroy the resource and returns an error. This rule doesn't prevent Terraform from destroying the resource if you remove the resource configuration. For instructions on how to remove a resource from state without destroying the actual resource, refer to [Remove a resource from state](/terraform/language/state/remove).
325325
- [`ignore_changes`](#ignore_changes): Specifies a list of resource attributes that Terraform ignores changes to. Otherwise, Terraform attempts to update the actual resource to match the configuration.
326326
- [`replace_triggered_by`](#replace-triggered_by): Terraform replaces the resource when any of the referenced resources or specified attributes change.
327327
- [`precondition`](#precondition): Specifies a condition that Terraform evaluates before creating the resource. Refer to [Validate your configuration](/terraform/language/validate) for more information.
@@ -375,7 +375,9 @@ resource {
375375

376376
Use this argument to prevent team members from accidentally replacing critical infrastructure, such as database instances.
377377

378-
When the `prevent_destroy` argument is set, you must either remove the resource from the configuration or change the `prevent_destroy` argument to `false` to destroy it. Use this argument with caution. The `prevent_destroy` argument can make applying resource changes or destroying resources more complex.
378+
When `prevent_destroy` is enabled, you must either remove the resource from the configuration or change the `prevent_destroy` argument to `false` to destroy it. Use this argument with caution. The `prevent_destroy` argument can make applying resource changes or destroying resources more complex.
379+
380+
This rule doesn't prevent Terraform from destroying the resource if you remove the resource configuration. For instructions on how to remove a resource from state without destroying the actual resource, refer to [Remove a resource from state](/terraform/language/state/remove).
379381

380382
#### Summary
381383

content/terraform/v1.13.x/docs/language/meta-arguments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ The `lifecycle` block accepts a rule that customizes how Terraform performs the
186186
| Rule | Description | Terraform block |
187187
| --- | --- | --- |
188188
| `create_before_destroy` | Terraform creates a replacement resource before destroying the current resource. | `resource` |
189-
| `prevent_destroy` | Terraform rejects operations to destroy the resource and returns an error. | `resource` |
189+
| `prevent_destroy` | Terraform rejects operations to destroy the resource and returns an error. This rule doesn't prevent Terraform from destroying a resource if you remove its configuration. Refer to [Remove a resource from state](/terraform/language/state/remove) for instructions on how to remove a resource from state without destroying the actual resource. | `resource` |
190190
| `ignore_changes` | Specifies a list of resource attributes that Terraform ignores changes to. Otherwise, Terraform attempts to update the actual resource to match the configuration. | `resource` |
191191
| `replace_triggered_by` | Terraform replaces the resource when any of the referenced resources or specified attributes change. | `resource` |
192192
| `precondition` | Specifies a condition that Terraform evaluates before creating the resource. | `data`, `ephemeral`, `resource` |

0 commit comments

Comments
 (0)