How do you safely remove a protected resource in production?
AdvancedProductionRefactoring, Migration and Drift
Answer
In sequence: first apply a change that turns off protection (deletion_protection = false, remove prevent_destroy) as its own PR, confirm it applied, then remove the resource in a second PR with a plan showing only that deletion, and have a snapshot or backup taken beforehand. Mixing protection removal and deletion in one PR hides the intent.
More on Refactoring, Migration and Drift
What is your workflow for refactoring Terraform safely?IntermediateHow do you rename a resource inside a shared module without breaking consumers?AdvancedHow do you split one state into two without downtime?AdvancedHow do you merge two states?IntermediateHow do you import a large existing environment efficiently?IntermediateHow do you upgrade a major version of the AWS provider?Advanced