Introduction
Sometimes you want to make sure important resources are never deleted by accident. Terraform has a rule called prevent_destroy that stops you from deleting a resource unless you remove the rule first.
When you have a database that should never be deleted accidentally.
When you manage critical infrastructure like a production server or network.
When you want to protect resources shared by many teams from accidental removal.
When you want to avoid downtime caused by deleting important resources.
When you want to enforce safety checks in your infrastructure automation.