Terraform State Doctor / Terraform状态诊断师

Detect and fix state drift, lock issues, and orphaned resources in Terraform projects. / 检测并修复Terraform项目中的状态漂移、锁定问题和孤立资源。

Install

openclaw skills install @kingaiwork/terraform-state-doctor

🩺 Terraform State Doctor / Terraform状态诊断师

Detect and fix state drift, lock issues, and orphaned resources in Terraform projects. / 检测并修复Terraform项目中的状态漂移、锁定问题和孤立资源。

🦁 由 KingAI.Work 出品 — 智能进化|vip@kingai.work


Quick Start / 快速开始

bash
terraform-state-doctor diagnose --state=production.tfstate Scans the production state file and outputs all drift, lock, and orphan issues with severity levels / 扫描生产状态文件,按严重等级输出所有漂移、锁定和孤立问题 

Features / 功能

• State Drift Detection: Scans real-time infrastructure vs state file, flags discrepancies instantly / 实时扫描基础设施与状态文件差异,秒级标记漂移风险,防止生产环境意外变更 • Lock Auto-Recovery: Forces release of stale locks with backup of current state / 自动释放过期锁并备份当前状态,告别手动解锁的痛苦流程 • Orphaned Resource Finder: Identifies cloud resources not tracked in any state file / 智能发现脱离状态管理的幽灵资源,避免云账单浪费 • Intelligent Diff Viewer: Side-by-side comparison of state versions with change summaries / 并排对比状态版本变更,每一行差异都附带中文解释,团队协作零障碍 • Pro-Only: Automated state healing scripts for batch drift corrections / 专业版独享:批量漂移自动修复脚本,一键恢复状态一致性 • Pro-Only: Multi-state correlation analysis across environments and accounts / 专业版独享:跨环境跨账号多状态关联分析,全局基础设施状态一目了然

Common Use Cases / 常见场景

• Developer accidentally runs terraform apply in two terminals, causing a state lock. Terraform State Doctor detects the stale lock and safely releases it with a backup / 开发者在两个终端同时执行terraform apply导致状态锁死,工具自动检测并安全释放,同时保留备份 • After a CI/CD pipeline failure, resources exist in AWS but not in the state file. The tool finds all orphaned EC2 and RDS instances, helping you import them back / CI/CD流水线故障后,云资源实际存在但状态文件缺失,工具扫描出所有孤立EC2和RDS实例,引导你重新导入 • A team member manually modifies cloud resources via console, causing state drift from Git. Terraform State Doctor flags every difference and generates a corrective plan / 团队成员通过控制台手动修改云资源导致与Git状态不符,工具标记所有差异并生成修正方案

Compare / 对比

FreePro
Basic
Advanced
AI
SupportCommunityPriority

• Automate batch fixes for dozens of drift errors in one command, saving hours of manual debugging 一键自动修复数十个漂移错误,将手动调试时间从小时级压缩到分钟级 • Gain full visibility across AWS, GCP, and Azure state files from a single dashboard 通过统一仪表盘,纵览AWS、GCP、Azure所有状态文件,跨云状态对比不再头疼 • Priority support with chat-based troubleshooting for complex state corruption cases 专业版用户享有优先技术支持,复杂状态损坏问题通过在线聊天实时解决\n\n

About the Publisher

Published by King AI — kingai.work | vip@kingai.work