A plan for a load balancer contains the line +/- resource "aws_lb" "main", and the resource sets lifecycle { create_before_destroy = true }. A junior reviewer asks what this marker means for the running service. What is the correct explanation?
Select an answer to reveal the explanation.
Short Explanation
Read the symbols like traffic signs: ~ is a quick touch-up, -/+ tears down first, and +/- builds the new one before knocking down the old. With create_before_destroy you get +/-, so you're never left without a load balancer. The trap is reading +/- as an in-place edit.
Full Explanation
Terraform's plan output prefixes each resource with a symbol for the planned action: + for create, ~ for update in place, - for destroy, -/+ for destroy and then create replacement, and +/- for create replacement and then destroy. Replacement happens when a changed argument cannot be updated in place. By default Terraform destroys the old object first, which is the -/+ case; when the resource sets create_before_destroy in its lifecycle block, Terraform reverses the order, creates the new object, updates dependents, and then destroys the old one, which the plan shows as +/-. For a load balancer this keeps a working object in place throughout the swap, though clients may still need to follow the new object's address if it changes. An in-place update is shown with ~ and does not create a new object. Destroying first is the -/+ case, which is what create_before_destroy prevents here. The -replace option forces a replacement that would not otherwise be planned; a replacement already shown in the plan happens on apply without it. Exam caveat: create_before_destroy can fail when names must be unique, because both objects exist briefly, so name prefixes or generated names are often required. Operational check: read the plan line for the forces replacement annotation to learn which argument triggers it, and confirm dependents are updated to the new object.