Q: A critical infrastructure configuration was manually modified via the AWS Console at 3 AM to fix an outage (Configuration Drift). The next morning, a CI pipeline runs `terraform apply` for an unrelated change. What happens and how do you reconcile this?
Because Terraform is declarative, it compares the desired state (the code) with the actual state (the AWS environment).
Want to master this scenario in a live sandbox? The Linux Foundation's Certified System Administrator (LFCS) & SRE Track covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "In our engineering organization, DevOps culture meant aligning developer speed with site reliability. The interviewer is testing: Infrastructure as Code drift, declarative state reconciliation.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."
Production Solution & Architecture
Because Terraform is declarative, it compares the desired state (the code) with the actual state (the AWS environment). When terraform apply runs, it will detect the 3 AM manual CLI/Console change, mark it as drift, and destroy the manual fix to revert the infrastructure back to exactly what is defined in the .tf files. To reconcile this: The manual change must be codified *before* anyone runs apply. A developer needs to write the equivalent Terraform code matching the manual 3 AM fix, run terraform plan to ensure zero changes are pending (meaning the code now perfectly matches reality), and then merge that code to main.
- Immediate Triage: Because Terraform is declarative, it compares the desired state (the code) with the actual stat
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Engineering bespoke in-house developer tools instead of adopting standardized platform Golden Paths when configuring General critical configuration Bespoke internal tools create long-term maintenance debt and fragmented workflows, whereas standardized Golden Paths accelerate delivery.
- Overlooking infrastructure cost visibility and FinOps allocation tagging across multi-tenant environments when configuring General critical configuration Without granular resource tagging, engineering organizations cannot attribute cloud infrastructure costs to specific teams or business units.
- Failing to define explicit Service Level Objectives (SLOs) and Error Budgets to balance feature velocity with reliability when configuring General critical configuration Without agreed SLOs, engineering and product teams lack an objective data-driven framework to prioritize technical debt over new features.
- Neglecting automated continuous drift detection between declarative configuration and deployed cloud state when configuring General critical configuration Unmanaged drift accumulates over time, causing future automated deployments to fail or overwrite emergency manual adjustments.