> For the complete documentation index, see [llms.txt](https://docs.infraglide.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infraglide.com/cloud-sync-and-drift-detection/overview.md).

# Real-Time Drift Detection Overview

**Drift** is any difference between what InfraGlide believes a managed resource should look like and what the live cloud API reports for that resource right now. Drift Detection helps you find out-of-band console edits, deleted resources, and unexpected attribute changes before they surprise the next deploy.

### ![alt text](/files/d8aSGp2gQmeHbmlK4pbp)

### What Drift Means in InfraGlide

For each tracked resource, InfraGlide stores a **desired configuration** (from the last successful pipeline apply / resource tracking). A drift check:

1. Loads tracked resources that have a saved desired configuration.
2. Calls the cloud provider (AWS, Azure, or GCP) to read the **live** resource state.
3. Diffs desired vs live field by field.
4. Writes or updates rows in `drift_events` when differences are found.

Important: drift is **not** computed by running `terraform plan`. It compares saved desired configuration against live SDK / describe results.

***

### Drift Change Types

Each drifted field is classified as one of:

| Change type  | Meaning                                                                                                                    |
| ------------ | -------------------------------------------------------------------------------------------------------------------------- |
| **missing**  | The resource (or an expected presence signal) is gone or inaccessible in the cloud.                                        |
| **added**    | An attribute exists in the **live reading** but is absent from the **desired configuration** (e.g., a manually added tag). |
| **modified** | The same field exists in both sides but the values differ.                                                                 |

Events also carry a lifecycle status (for example `open`, `acknowledged`, `resolved`) and a severity.

***

### Where You Work With Drift

![alt text](/files/Y7kKjOB9tatxl2ZN8pNU)

#### Drift Detection page

Open **Operations → Drift Detection** (Drift Report).

* Review pipelines that currently have open drift.
* Click **Run drift check on all pipelines** to start an organization-wide scan (HTTP 202; progress is polled separately).
* Run a check for a single pipeline from the designer pipeline menu (**Check drift**) or via the per-pipeline API.
* Open event details to inspect field-level expected vs actual values. ![alt text](/files/HVf6rxF96jWwKvu1Bj4x) The page notes that **automatic scheduled scans are disabled unless enabled by your administrator**.

#### Pipeline Designer

* A **Drift** badge appears in the toolbar when open drift events exist for the pipeline.
* Open events can overlay on canvas resources so you can jump to the affected node. ![alt text](/files/bFIjyqrFcWezekG2rhRV)

#### After Terraform completes

InfraGlide can re-check drift for a pipeline after apply finishes, so a successful deploy that brought the cloud back in line can clear stale signals.

***

### Running Checks

| Action          | How                                                                                                                          |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Org-wide scan   | **Run drift check on all pipelines** on the Drift Detection page                                                             |
| Single pipeline | Designer → pipeline menu → **Check drift**                                                                                   |
| Scheduled scan  | Administrator sets `DRIFT_CHECK_INTERVAL_MINUTES` to a value greater than `0` and leaves `DRIFT_CRON_DISABLED` unset/`false` |

Scheduled scanning is **opt-in**. The default interval is effectively off (`0`).

Jane AI posture / watchdog agents can also trigger org-wide checks when those features are enabled in your environment.

***

### Responding to Drift

You have three primary responses for an event:

#### 1. Acknowledge

Mark the event as seen without changing configuration. Use this when you are investigating or accepting temporary drift.

#### 2. Resolve (manual)

Mark the event resolved without syncing values. Use this when you fixed the cloud outside InfraGlide or decided the event is no longer relevant.

#### 3. Sync from cloud

**Sync from cloud** updates the pipeline canvas configuration from the live cloud values for the drifted resource, then you review, save, and redeploy if you want Terraform to own that new desired state going forward.

* This path updates InfraGlide's saved config — it does **not** write changes back to the cloud by itself.
* To push canvas intent into the cloud, save the pipeline and run **Deploy** (`apply`) as usual.
* Jane AI can explain a drift event or suggest remediation patches; applying a patch to the canvas is still a user-confirmed step.

![alt text](/files/HWLz4qggLwd358iO0nsX)

There is no automatic “force cloud to match canvas” reconcile API separate from a normal Terraform apply.

***

### Prerequisites and Limits

* Resources must be tracked in InfraGlide (`master_resources` with `desiredConfig`) — typically after a successful apply and resource tracking pass.
* The pipeline must have a valid credential for live reads.
* Some provider readers intentionally avoid false **missing** results when a live lookup cannot be verified safely.
* Drift details are field-level diffs; they are a configuration comparison, not a full Terraform plan graph.

***

### See also

* [Cloud Inventory Discovery](/cloud-sync-and-drift-detection/inventory-discovery.md)
* [Plan, Deploy & Destroy Actions](/deployments-and-execution-history/execution-actions.md)
* [Jane AI Overview](/jane-ai-copilot/overview.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.infraglide.com/cloud-sync-and-drift-detection/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
