Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ By default, after you remove the `resource` block, Terraform will plan to destro

Sometimes you may wish to remove a resource from your Terraform configuration without destroying the real infrastructure object it manages. In this case, the resource will be removed from the [Terraform state](/terraform/language/state), but the real infrastructure object will not be destroyed.

To declare that a resource was removed from Terraform configuration but that its managed object should not be destroyed, remove the `resource` block from your configuration and replace it with a `removed` block:
To declare that a resource was removed from the Terraform configuration but that its managed object should not be destroyed, remove the `resource` block from your configuration and replace it with a `removed` block:

```hcl
removed {
from = aws_instance.example

lifecycle {
destroy = false
prevent_destroy = false
}
}
```
Expand All @@ -144,7 +144,7 @@ removed {
from = aws_instance.example

lifecycle {
destroy = true
prevent_destroy = true
}

provisioner "local-exec" {
Expand Down
Loading