Introduction
Sometimes, you want to force Terraform to replace a resource even if it thinks the resource is fine. Terraform used to have commands called taint and untaint to mark resources for replacement or to undo that marking. These commands are now deprecated and replaced by better methods.
When a resource is broken or misconfigured but Terraform does not detect it as changed.
When you want to force recreate a resource without changing its configuration.
When you accidentally marked a resource for replacement and want to cancel that.
When debugging infrastructure issues by forcing resource replacement.
When migrating from older Terraform versions that used taint and untaint commands.