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.
More on State Internals
What does the state file contain?BeginnerWhat is the difference between local and remote state?BeginnerHow do you configure the S3 backend?BeginnerWhat is state locking and why does it matter?IntermediateHow does S3-native locking work and how does it replace DynamoDB?AdvancedHow do you inspect resources in state?Beginner