Someone Changed Infra by Hand. Terraform Plan Is a Mess.

A manual console change put Terraform's state out of sync, and the next plan wants to undo it. Defend how you reconcile it.

intermediate12 min5 roundsTerraform

Answer key reviewed by Branko Petric

Read first: Terraform State Explained

Your decision

An engineer made a change in the cloud console by hand, and now terraform plan shows a confusing diff that wants to revert their change. State and reality are out of sync. How do you reconcile this safely?

The situation

You run terraform plan before a routine change and get a large, confusing diff: Terraform wants to revert several settings on a load balancer and a security group. Nothing in your code changed.

Context

An on-call engineer made a quick fix directly in the cloud console during an incident last night and did not record it in code. State is in a shared remote backend. You are not yet sure whether their manual change was correct and should stay, or was a temporary hack.

More: Terraform scenario interview questions