A web service runs on instances behind a load balancer. A new machine image must be rolled out, and changing the image forces replacement of the instances. The release must not cause an outage, and rollback must be fast if the new version misbehaves. Which deployment strategy fits?
Select an answer to reveal the explanation.
Short Explanation
Blue-green is like building a new bridge next to the old one: traffic keeps flowing on the old bridge until the new one passes inspection. Then you switch lanes. If something's wrong, you switch right back.
Full Explanation
A blue/green deployment runs the new version beside the current one and moves traffic only after the new environment proves healthy. In Terraform this usually means parameterizing the configuration so a second instance group with the new image is created while the first keeps serving, then changing the load balancer's target to the new group once health checks pass, and finally removing the old group in a later change. Because the old group stays intact until it is deliberately removed, rollback is a fast switch back. Where a single resource must be replaced in place, create_before_destroy gives a similar overlap. -replace forces replacement but follows the default destroy-then-create order, so the old instances are removed before replacements exist. prevent_destroy makes Terraform reject any plan that would destroy the instances; it does not reorder replacement or swap traffic. ignore_changes on the image stops Terraform from ever proposing the new image, so nothing is rolled out. Exam caveat: blue/green temporarily doubles capacity, so check quotas and cost before relying on it. Operational check: before removing the old group, confirm the load balancer reports all new targets healthy and that error rates remain normal under production traffic.