Prompt

Why does Terraform keep detecting drift on unchanged resources?

Technology / Cloud Infrastructure1 observationLast seen Oct 25, 2026

Latest observation

Oct 25, 2026OpenAI APIWeb search: off

Terraform can report drift on resources even when you haven’t intentionally changed anything for a few common reasons:

1) The provider reads values that are computed or normalized

Some resource attributes are set by the provider or API after creation, not by your config. Examples:

  • timestamps
  • IDs
  • defaulted fields
  • ordering of lists/sets
  • API-normalized values like case changes, whitespace, or JSON formatting

Terraform sees the refreshed state and thinks it differs from config.

2) The remote system changes things automatically

Cloud services often mutate resources behind the scenes:

  • security group rules reordered
  • tags added by the platform
  • passwords/keys rotated
  • defaults injected by the API
  • managed services adjusting settings

Terraform refreshes from the API and detects those differences.

3) The provider has inconsistent diff handling

Sometimes the provider itself has bugs or imperfect schemas:

  • incorrect Computed / Optional flags
  • unstable field ordering
  • force-new attributes changing unexpectedly
  • fields that are semantically equal but textually different

This is a common cause of “phantom drift.”

4) Your config and the remote object aren’t actually identical

Even small differences matter:

  • null vs empty string
  • list vs set ordering
  • omitted argument vs explicit default
  • numeric/string type coercion
  • case sensitivity

5) Data source or dynamic input changes

If your config uses:

  • timestamp()
  • random_* resources without stable keepers
  • filesha* on changing files
  • external data sources
  • values from CI/CD environment variables

then the plan can change even though the managed resource itself didn’t.

6) State is stale or was modified externally

If state wasn’t refreshed correctly, or someone changed the resource outside Terraform, drift can appear. Less commonly:

  • backend/state locking issues
  • partial applies
  • manual state edits
  • importing with slightly different settings

How to diagnose

  1. Run:

    terraform plan
    

    Look closely at which attribute is changing.

  2. Refresh state only:

    terraform plan -refresh-only
    

    This shows what Terraform thinks changed in the real world.

  3. Compare config, state, and remote API output if possible.

  4. Check provider docs/issues for known drift bugs.

  5. If the change is expected and harmless, consider:

    • lifecycle { ignore_changes = [...] }
    • setting the attribute explicitly
    • upgrading the provider

Best fix depends on the cause

  • API normalization/order changes → use stable types, explicit ordering, or ignore_changes
  • Automatic platform changes → configure the service to stop mutating if possible
  • Provider bug → upgrade or pin a different provider version
  • Dynamic inputs → remove non-deterministic functions from resource arguments

If you want, I can help interpret a specific Terraform plan diff and tell you why that exact drift is happening.

Brands

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.