Open
Description
Background
While working with existing Terraform configuration that has already been deployed, users may sometime wish to "dis-own" a particular resource, or a module, i.e. prevent Terraform from managing it but not destroy it in the process of doing so.
Previously this was done via terraform state rm
and Terraform v1.7 comes with a removed {}
block which provides equivalent functionality via configuration.
Users may begin with
resource "aws_instance" "to-disown" {
// ...
}
and end up with
removed {
from = aws_instance.to-disown
lifecycle {
destroy = false
}
}
Proposal
- Provide code actions to remove stateful blocks, i.e. replace them with
removed {}
block- Remove
resource
- Remove
data
- Remove
module
- Remove