When you read Terraform docs there's a page with lifecycle attributes that you can specify for the resources. Among the others there's prevent_destroy attribute whose behaviour is documented as:
prevent_destroy (bool) - This flag provides extra protection against the destruction of a given resource. When this is set to true, any plan that includes a destroy...
Read More