Skip to content
analyze-state logo

State Analyzer

analyze-state

Terraform state を分析・操作する。「state 確認」「state list」「state show」「リソース一覧」「state の移動」「state mv」「state rm」「terraform state」「state 操作」「リソースの状態」「state pull」などで起動。

SKILL.md

Full skill instructions

State Analyzer

Terraform state ファイルの分析と操作を支援します。

対応操作

操作トリガー例コマンド
一覧表示「state list」「リソース一覧」terraform state list
詳細表示「state show」「リソース詳細」terraform state show
リモート取得「state pull」「state 取得」terraform state pull
移動「state mv」「リソース移動」terraform state mv
削除「state rm」「state から削除」terraform state rm

実行手順

1. 操作の判定

ユーザーの発話から操作を判定:

  • 一覧系: 「list」「一覧」「確認」→ state list
  • 詳細系: 「show」「詳細」「内容」→ state show
  • 取得系: 「pull」「取得」「ダウンロード」→ state pull
  • 移動系: 「mv」「移動」「rename」→ state mv
  • 削除系: 「rm」「削除」「remove」→ state rm

2. state list

terraform state list

出力例:

aws_instance.web
aws_security_group.web
aws_vpc.main

3. state show

terraform state show {resource_address}

出力例:

# aws_instance.web:
resource "aws_instance" "web" {
    ami                          = "ami-12345678"
    instance_type                = "t3.micro"
    ...
}

4. state pull

terraform state pull

リモートバックエンドから state をダウンロードして表示。

5. state mv(手動実行を案内)

重要: state mv はリソースのアドレスを変更する危険な操作のため、自動実行は禁止されています。

ユーザーに手動実行を案内:

## State 移動

以下のコマンドを手動で実行してください:

terraform state mv {source} {destination}

⚠️ 注意:
- この操作は state を変更します
- 実行前に terraform state list で現在の状態を確認してください
- 間違った移動は terraform state mv で戻せます

6. state rm(手動実行を案内)

重要: state rm はリソースを state から削除する危険な操作のため、自動実行は禁止されています。

ユーザーに手動実行を案内:

## State 削除

以下のコマンドを手動で実行してください:

terraform state rm {resource_address}

⚠️ 注意:
- 実際のインフラリソースは削除されません
- state から削除すると Terraform の管理外になります
- 再度管理するには import が必要です

7. 出力フォーマット

state list:

## State リソース一覧

| # | リソースアドレス |
|---|-----------------|
| 1 | aws_instance.web |
| 2 | aws_security_group.web |
| ... | ... |

合計: {N} リソース

state show:

## リソース詳細: {resource_address}

### 主要属性

| 属性 | 値 |
|------|-----|
| id | {id} |
| ... | ... |

### 全属性

{terraform state show の出力}

よくある使い方

リソースのリネーム

# 旧名から新名に移動
terraform state mv aws_instance.old_name aws_instance.new_name

モジュール化

# ルートからモジュール内に移動
terraform state mv aws_instance.web module.web.aws_instance.main

state から除外

# 管理対象外にする
terraform state rm aws_instance.legacy

注意事項

  • ✅ state list / state show / state pull は読み取り専用で安全
  • ⚠️ state mv / state rm は state を変更する操作
  • ⚠️ state rm は実リソースを削除しない(Terraform 管理外になるだけ)
  • ❌ 確認なしで state mv / state rm を実行しない

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View