An engineer changes the name argument on a production managed database resource to match a new naming standard. The plan marks the database with -/+ and shows # forces replacement beside the name attribute. What does the plan mean?
Select an answer to reveal the explanation.
Short Explanation
That -/+ is Terraform waving a red flag: this isn't an edit, it's a demolition followed by new construction. For a database that means data loss unless you stop and rethink before you apply.
Full Explanation
When a provider schema marks an attribute as requiring replacement, Terraform cannot update it in place, so the plan shows the resource with the -/+ symbol, the summary counts it as both an add and a destroy, and the offending attribute is annotated as forcing replacement. The default order is destroy first and then create, which for a stateful database means losing its data unless the change is reconsidered. An in-place update appears with the ~ symbol, not -/+, so the reading that Terraform will rename the database without replacement contradicts the plan symbols. A changed resource address produces a separate destroy of the old address and create of the new one, not a single -/+ entry annotated with an attribute, and a moved block would not prevent an attribute-driven replacement. With create_before_destroy the replacement order flips and the plan shows +/-; that argument never turns an in-place update into a replacement. Exam caveat: treat any replacement of stateful resources as a review-blocking event and consider prevent_destroy on databases. Operational check: run terraform show -json on the saved plan and confirm whether the database's actions list contains both delete and create before approving any apply.