Removed blocks and ownership transfer
Separate ownership from existence
A resource can remain in service after Terraform stops managing it. Removing its state binding is not equivalent to deleting the object, stopping charges, granting ownership to another tool, or transferring its secrets. Conversely, simply deleting a managed resource declaration ordinarily proposes destruction. Before changing ownership, identify the object, current owner, receiving owner, account, provider context, dependencies, monitoring and recovery responsibilities. The examples below use an imaginary provider and are not executable.
Declare a non-destructive removal
Replace the original declaration for the fictional catalog resource with the following block and remove or redesign references to its attributes.
# Fictional provider schema: illustrative, never execute.removed { from = demo_record.catalog
lifecycle { destroy = false }}The from address identifies the managed resource. With destroy set to false, the intended plan forgets its binding while leaving the actual object in place. If destroy is omitted or true, the default is to destroy the object; never omit the explicit false when the goal is preservation. The removal is persisted only by applying the reviewed plan. Current documentation for resource removal does not permit individual instance keys in this form when the resource has multiple instances. Treat a whole-resource removal as affecting every instance and check its scope.
Contrast a direct state removal
An authorized operator may use state rm for a controlled case, such as selecting a specific keyed instance. This POSIX-shell illustration uses a fictitious provider address.
# Fictional address: illustration only.terraform state rm -dry-run 'demo_record.catalogs["east"]'# Actual removal is a separate, authorized state mutation.terraform state rm 'demo_record.catalogs["east"]'The dry run identifies bindings that would be removed. The actual command forgets those bindings without deleting remote objects. If the corresponding configuration remains active, the next plan can propose creating replacements, potentially colliding with existing names. Coordinate configuration and state changes; do not use state rm to silence an unexplained plan. A direct state edit is not a substitute for an approved handoff.
Transfer responsibility between roots
In a cross-state transfer, use an approved change window: inventory and back up both states, verify the destination configuration and identity, freeze competing changes, review the source removal with destroy=false, and review the destination adoption plan. Apply the source removal and promptly perform the approved import into the destination; during the gap the object has no Terraform owner. Do not allow both roots to manage it at once. If adoption fails, preserve the object, keep the freeze and follow a reviewed recovery path, such as reimporting into the source. Never blindly overwrite a state backup over later changes. This process is not atomic; document every step.
Read the effect rather than the label
These invented summaries are not real Terraform output.
A: old.catalog -> new.catalog; same ID; no changes.B: old.catalog forgotten; object remains.C: old.catalog scheduled for deletion.D: old.catalog forgotten; old configuration still proposes create.A describes an address move in one state (addresses abbreviated). B describes a non-destructive release of ownership, requiring a receiving owner or documented manual operation. C is destruction and must be rejected if the intent is preservation. D is an incomplete handoff; stop and reconcile the configuration. Even a zero-change plan is not a health check. Confirm the final state addresses, service behavior, ongoing costs and accountable owner.
Practice the handoff decision
Use the synthetic review cases. For every case, record whether the intended outcome is a move, forget, destroy or blocked operation. Explain what happens to the state binding and to the underlying object separately. No provider, network or real state is needed.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Removed blocks and ownership transfer — knowledge check
Review refactoring, state identity and ownership safety.
Which setting keeps the object during a removed block operation?
What is the default removal behavior when destroy is omitted?
What can happen if state rm forgets a binding but the configuration stays?
What is the safest treatment of a cross-root transfer?
After a non-destructive removal, what should the team verify?