When do you use `terraform state rm`?
IntermediateConceptState Internals
Answer
To make Terraform forget a resource without destroying it, for example when handing ownership to another stack or removing a resource that was already deleted by hand. The real object remains and is no longer managed. In Terraform 1.7+ a removed block does the same declaratively.
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