<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/infrastructure-as-code-how-to-stop-configuration-drift-cjpzbtrb4" -->

---
title: Infrastructure as Code: How to Stop Configuration Drift
description: Configuration drift — the divergence between what your IaC code declares and what your infrastructure actually is — quietly undermines the entire promise of...
canonical: https://daily.dev/posts/infrastructure-as-code-how-to-stop-configuration-drift-cjpzbtrb4
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Infrastructure as Code: How to Stop Configuration Drift | daily.dev
og:description: Configuration drift — the divergence between what your IaC code declares and what your infrastructure actually is — quietly undermines the entire promise of...
og:url: https://daily.dev/posts/infrastructure-as-code-how-to-stop-configuration-drift-cjpzbtrb4
og:image: https://api.daily.dev/og/posts/cjpzbtRB4.png
og:image:alt: Infrastructure as Code: How to Stop Configuration Drift
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Infrastructure as Code: How to Stop Configuration Drift

**[Medium](https://daily.dev/sources/medium_js)** · 6 min read · 1 upvotes · 0 comments

## Summary

Configuration drift — the divergence between what your IaC code declares and what your infrastructure actually is — quietly undermines the entire promise of Infrastructure as Code. Four practical fixes are outlined: (1) run scheduled drift detection using `terraform plan -detailed-exitcode` or tools like driftctl; (2) restrict console/CLI write access so code is the only path to production changes; (3) reconcile drift thoughtfully by deciding whether to codify the manual change or revert it, never blindly applying; and (4) maintain state hygiene with remote locking and modular components to limit blast radius. The core principle is keeping code and cloud reality in agreement so IaC remains a reliable single source of truth.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@najmul.hasan284/infrastructure-as-code-how-to-stop-configuration-drift-b82d582c1582>

## Similar posts on daily.dev

- [Configuration Drift in a Multi-Cloud World](https://daily.dev/posts/configuration-drift-in-a-multi-cloud-world-zca5snbco) · DevOps.com · 0 upvotes · 0 comments
- [5 Infrastructure as Code Security Issues & How to Fix Them](https://daily.dev/posts/5-infrastructure-as-code-security-issues-how-to-fix-them-hwwtvuzpp) · Spacelift · 0 upvotes · 0 comments
- [Terraform Cloud Drift Detection: How It Works & Setup](https://daily.dev/posts/terraform-cloud-drift-detection-how-it-works-setup-yy64xu1m1) · Spacelift · 0 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#cicd](https://daily.dev/tags/cicd), [#terraform](https://daily.dev/tags/terraform), [#iac](https://daily.dev/tags/iac)

[View this post on daily.dev](https://daily.dev/posts/infrastructure-as-code-how-to-stop-configuration-drift-cjpzbtrb4)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Infrastructure as Code: How to Stop Configuration Drift","url":"https://daily.dev/posts/infrastructure-as-code-how-to-stop-configuration-drift-cjpzbtrb4","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/infrastructure-as-code-how-to-stop-configuration-drift-cjpzbtrb4"},"datePublished":"2026-07-22T07:31:46.662Z","dateModified":"2026-07-22T07:33:24.330Z","description":"Configuration drift — the divergence between what your IaC code declares and what your infrastructure actually is — quietly undermines the entire promise of...","image":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","thumbnailUrl":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/infrastructure-as-code-how-to-stop-configuration-drift-cjpzbtrb4","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,cicd,terraform,iac","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Infrastructure as Code: How to Stop Configuration Drift"}]}
```

