Interview Prep/Terraform/State Internals

What is the `removed` block?

IntermediateConceptState Internals
Answer

Introduced in Terraform 1.7, it removes a resource from state without destroying the real object.

removed {
  from = aws_instance.legacy
  lifecycle { destroy = false }
}

Without destroy = false Terraform plans to destroy the resource. It is the reviewable replacement for state rm.

All Terraform questions Roadmap: Terraform in production

More on State Internals