The pipeline failed. Not because the code was wrong, but because the infrastructure no longer matched the plan.
Infrastructure as Code (IaC) drift happens when the state in your cloud changes without going through your IaC workflows. Manual edits in the console. Emergency fixes. Quick changes pushed outside of version control. Each one splinters reality away from your repository. Over time, the gap grows and the risk multiplies.
Drift detection catches these changes fast. It compares your IaC definitions to the actual deployed resources. When they differ, you see exactly what shifted, down to the resource and property level. This is the first defense against fragile, unreliable environments. Without it, rollbacks fail, reproducibility disappears, and compliance gets shredded.
Separation of duties locks down who can make changes and how. It enforces the rule that no single person can both approve and apply changes. In IaC, this means defining strict permissions in your CI/CD pipelines and cloud accounts. Developers propose changes in code. Reviewers approve through pull requests. Deployers run controlled applies. By splitting these roles, you contain blast radius, build audit trails, and strengthen security posture.