Skip to content

Fix drift detection to trigger replace in terraform plan - #159

Merged
devops-rob merged 2 commits into
mainfrom
fix/drift-plan-replace
Jul 21, 2026
Merged

Fix drift detection to trigger replace in terraform plan#159
devops-rob merged 2 commits into
mainfrom
fix/drift-plan-replace

Conversation

@devops-rob

@devops-rob devops-rob commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Detect remote response drift during ModifyPlan and set RequiresReplace on drift_marker, so terraform plan shows replacement instead of "No changes"
  • Preserve stored response / sensitive_response in state when drift is detected during Read() until replacement completes
  • Add unit and acceptance tests for drift-triggered replace; document drift behavior in request resource docs
  • CHANGELOG 2.5.2

Closes #133

Test plan

  • go test ./internal/provider/... -count=1
  • CI acceptance tests across Terraform versions

Made with Cursor

Use ModifyPlan to force resource replacement when read drift is detected,
and preserve stored response fields until replace completes. Closes #133.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Remove stale tfplugindocs frontmatter comment so the generate CI check passes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@devops-rob
devops-rob merged commit 66eaafc into main Jul 21, 2026
26 checks passed
@devops-rob
devops-rob deleted the fix/drift-plan-replace branch July 21, 2026 15:37
@devops-rob

Copy link
Copy Markdown
Owner Author

Merged. This closes #133.

Ships in 2.5.2 — drift during read now surfaces as a planned replace via ModifyPlan instead of only logging during Read().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Drift not being fixed even though debug logs indicate it should

1 participant