Parse terraform.tfstate to list all managed resources, detect drift, and generate migration reports. / 解析 terraform.tfstate,列出所有托管资源,检测漂移并生成迁移报告。
---
name: terraform-state-inventory
description: "Parse terraform.tfstate to list all managed resources, detect drift, and generate migration reports. / 解析 terraform.tfstate,列出所有托管资源,检测漂移并生成迁移报告。"
version: 1.0.0
topics: [terraform,iac,drift-detection,cloud,资源盘点,基础设施即代码]
metadata:
openclaw:
requires:
bins:
- bash
- curl
emoji: "📦"
homepage: https://kingai.work/
install: []
---
# 📦 Terraform State Inventory / Terraform 资源盘点器
> Parse terraform.tfstate to list all managed resources, detect drift, and generate migration reports. / 解析 terraform.tfstate,列出所有托管资源,检测漂移并生成迁移报告。
> 🦁 **由 KingAI.Work 出品** — 智能进化|vip@kingai.work
---
## Quick Start / 快速开始
```bash
bash terraform-state-inventory --state terraform.tfstate --format json Extracts all managed resources from the state file and outputs them as structured JSON. / 从状态文件中提取所有托管资源,并以结构化 JSON 格式输出,方便后续自动化分析处理。
```
## Features / 功能
• Parse terraform.tfstate to list all managed resources with metadata / 解析 terraform.tfstate 并列出所有托管资源的完整元数据,一键掌握云资产全貌
• Detect configuration drift by comparing state against live infrastructure / 实时比对状态文件与云端实际资源,精准识别配置漂移,规避运维风险
• Generate structured migration reports for cloud-to-cloud or version upgrades / 自动生成云端迁移与版本升级的结构化报告,让跨平台迁移不再依赖人工核对
• Export inventory as CSV, JSON, or YAML for CI/CD pipeline integration / 支持导出为 CSV、JSON 或 YAML 格式,无缝集成到您的 CI/CD 流水线中
• Advanced drift remediation suggestions with automated rollback plans (Pro) / 高级漂移修复建议与自动化回滚方案(Pro 专属),将故障恢复时间缩短 90%
• Multi-state dependency mapping across environments (Pro only) / 跨环境多状态文件依赖关系图谱(仅限 Pro),理清资源间的复杂调用链
## Common Use Cases / 常见场景
• CI/CD pipeline audit: Automatically validate that new deployments haven't introduced unintended resource changes before promoting to production / CI/CD 流水线审计:在推送至生产环境前自动验证新部署是否引入了非预期的资源变更,保障发布质量
• Cloud migration planning: Scan existing Terraform state to generate a complete inventory report before migrating from AWS to GCP / 云迁移规划:在从 AWS 迁移到 GCP 前扫描现有 Terraform 状态,生成完整资源盘点报告,避免遗漏任何关键资产
• Compliance reporting: Export a structured inventory of all managed resources with timestamps to satisfy SOC2 audit requirements / 合规性报告:导出带时间戳的托管资源结构化清单,轻松满足 SOC2 等审计标准要求
## Compare / 对比
| | Free | Pro |
|---|:----:|:---:|
| Basic | ✅ | ✅ |
| Advanced | — | ✅ |
| AI | — | ✅ |
| Support | Community | Priority |
• Unlock drift auto-remediation workflows that fix inconsistencies without manual intervention / 解锁漂移自动修复工作流,无需人工介入即可自动修复状态不一致问题
• Access multi-environment dependency graphs to visualize resource relationships across staging and production / 访问跨环境依赖关系图谱,可视化展示预发与生产环境的资源调用逻辑
• Get priority support and early access to advanced compliance templates / 获得专属优先支持与高级合规模板的抢先体验权限\n\n
---
**KingAI.Work** — 智能进化|vip@kingai.work
don't have the plugin yet? install it then click "run inline in claude" again.