Forum Discussion
Crossplane Metal provider - lifecycle.prevent_destroy error
Are you using a management policy or non-default delete policy? https://docs.crossplane.io/latest/concepts/managed-resources/#interaction-with-management-policies
I see "has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed" in a number of provider GitHub issues, for AWS, Azure, and others.
I'm curious if the deletion is being triggered due to some detected drift and a need to update based on the plan. I would expect the resource to successfully delete and recreate in that case (perhaps in a loop, which wouldn't be desirable).
It would help to have a better example of the minimum XRD to reproduce this problem. Debugging output from the provider may also reveal some helpful details: https://docs.crossplane.io/latest/guides/troubleshoot-crossplane/#provider-logs