Skip to content

Commit ea8d71f

Browse files
committed
first commit - draft clarification on M-A docs
1 parent b8612c9 commit ea8d71f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

content/terraform/v1.14.x (beta)/docs/language/meta-arguments.mdx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,26 @@ Terraform performs the following operations when you apply a configuration:
185185
1. Creates resources defined in the configuration that are not associated with a real infrastructure object in the state.
186186
1. Destroys resources that exist in the state but not in the configuration.
187187
1. Updates in-place resources whose arguments have changed.
188-
1. Destroys and re-create resources whose arguments have changed but that Terraform cannot update in-place because of remote API limitations.
188+
1. Destroys and re-creates resources whose arguments have changed but that Terraform cannot update in-place because of remote API limitations.
189189
1. Invokes actions that are configured to run during an apply operation.
190190

191-
The `lifecycle` block accepts a rule that customizes how Terraform performs the lifecycle stages for each resource. Support for each `lifecycle` rule varies across Terraform configuration blocks. Refer to the reference documentation for the Terraform block you are adding to your configuration for details. The following table describes support for each `lifecycle` rule:
191+
The `lifecycle` block accepts a rule that customizes how Terraform performs the lifecycle stages for each resource. Support for each `lifecycle` rule varies across Terraform configuration blocks. Refer to the reference documentation for the Terraform block you are adding to your configuration for details.
192192

193+
### State
194+
195+
Except for `create_before_destroy`, Terraform does not explicitly record a resource's `lifecycle` rule to state. As a result, Terraform destroys the actual infrastructure during an apply operation if you remove the resource's configuration, even if `prevent_destroy` is enabled. 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.
196+
197+
Terraform records the results of `precondition` and `postcondition` checks to state, but not the contents of the checks. Terraform may also record values in `lifecycle` rules as resource dependencies.
198+
199+
### Rules
200+
201+
The following table describes support for each `lifecycle` rule:
193202

194203
| Rule | Description | Terraform block |
195204
| --- | --- | --- |
196205
| `action_trigger` | Terraform runs the configured action when the specified conditions are met. Refer to [Invoke an action](/terraform/language/invoke-actions) for details. | `resource` |
197206
| `create_before_destroy` | Terraform creates a replacement resource before destroying the current resource. | `resource` |
198-
| `prevent_destroy` | Terraform rejects operations to destroy the resource and returns an error. | `resource` |
207+
| `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` |
199208
| `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` |
200209
| `replace_triggered_by` | Terraform replaces the resource when any of the referenced resources or specified attributes change. | `resource` |
201210
| `precondition` | Specifies a condition that Terraform evaluates before creating the resource. | `data`, `ephemeral`, `resource` |

0 commit comments

Comments
 (0)