Interview Prep/Terraform/Import Refactoring Drift and Lifecycle

How do you accept a harmless drift into state without changing infrastructure?

BeginnerScenarioImport Refactoring Drift and Lifecycle
Answer

Situation read → The cloud changed an attribute you're happy with, such as a tag added by another system.

What I'd do →

  1. terraform plan -refresh-only to review what changed.
  2. terraform apply -refresh-only to record it in state.
  3. Update the code to match so the next normal plan is clean.

Why → Refresh-only changes state only, never infrastructure.

Interview tip → Without step 3 the next plan will try to revert it.

All Terraform questions Roadmap: Terraform in production

More on Import Refactoring Drift and Lifecycle