terraform-azurerm-set-diff-analyzer
できること
Azureリソース用のTerraformのplan出力を分析するツールです。Azureの一部のリソースは項目のリストの扱い方が原因で、実際にはわずかな変更しかない、あるいは変更がないのに大きな変更に見えることがあります。そのような変更を見分けるのに役立ちます。
使う場面
- ✓`terraform plan`で多くの変更が表示されるのに、実際には項目を1つ追加または削除しただけのとき。
- ✓Application GatewayやLoad Balancerなどのリソースで「all elements changed」と表示されるとき。
- ✓自動化の処理(CI/CD)で、誤検知の変更を自動的に除外したいとき。
スキルのリンク
https://github.com/github/awesome-copilot/blob/main/skills/terraform-azurerm-set-diff-analyzer/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のTerraform planを分析して、どの変更が本物で、どの変更が誤検知かを教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このツールは、Terraformのplan出力を、こうした「誤検知の変更」を引き起こすことが知られているリソースや属性の一覧と比較します。並び順の問題を起こす「Set」型の属性に注目します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Terraform AzureRM Set Diff Analyzer
A skill to identify "false-positive diffs" in Terraform plans caused by AzureRM Provider's Set-type attributes and distinguish them from actual changes.
When to Use
terraform planshows many changes, but you only added/removed a single element- Application Gateway, Load Balancer, NSG, etc. show "all elements changed"
- You want to automatically filter false-positive diffs in CI/CD
Background
Terraform's Set type compares by position rather than by key, so when adding or removing elements, all elements appear as "changed". This is a general Terraform issue, but it's particularly noticeable with AzureRM resources that heavily use Set-type attributes like Application Gateway, Load Balancer, and NSG.
These "false-positive diffs" don't actually affect the resources, but they make reviewing terraform plan output difficult.
Prerequisites
- Python 3.8+
If Python is unavailable, install via your package manager (e.g., apt install python3, brew install python3) or from python.org.
Basic Usage
# 1. Generate plan JSON output
terraform plan -out=plan.tfplan
terraform show -json plan.tfplan > plan.json
# 2. Analyze
python scripts/analyze_plan.py plan.json
Troubleshooting
python: command not found: Usepython3instead, or install PythonModuleNotFoundError: Script uses only standard library; ensure Python 3.8+
Detailed Documentation
- scripts/README.md - All options, output formats, exit codes, CI/CD examples
- references/azurerm_set_attributes.md - Supported resources and attributes
よくある質問
「誤検知の変更」とは何ですか?
Terraformがplanで変更として表示しても、Azure上のリソースは実際には変わっていないものです。一部のリストでは項目の内容ではなく並び順が比較されるため、このようなことが起こります。
何かインストールする必要がありますか?
はい。お使いのコンピューターにPython 3.8以上がインストールされている必要があります。
どのように使いますか?
まず、Terraformのplanファイルを生成します(`terraform plan -out=plan.tfplan`と`terraform show -json plan.tfplan > plan.json`)。次に、生成したファイルを指定してPythonスクリプトを実行します(`python scripts/analyze_plan.py plan.json`)。
詳細
作者による元の説明
Analyze Terraform plan JSON output for AzureRM Provider to distinguish between false-positive diffs (order-only changes in Set-type attributes) and actual resource changes. Use when reviewing terraform plan output for Azure resources like Application Gateway, Load Balancer, Firewall, Front Door, NSG, and other resources with Set-type attributes that cause spurious diffs due to internal ordering ch
repo: github/awesome-copilot
人気
- GitHubのスター
- 40k
- ランキング
- #7449
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
acquire-codebase-knowledge
40kエージェントが、既存のコードプロジェクトを理解してドキュメント化できるよう支援します。新しく参加するメンバーのオンボーディングや、アーキテクチャの全体像の把握に役立ちます。
acreadiness-assess
40kエージェントが、プロジェクトのAI対応状況を評価してレポートを生成できるよう支援します。プロジェクトがAIツールをどの程度活用できる状態にあるかを把握するのに役立ちます。
acreadiness-generate-instructions
40kエージェントが、評価結果をもとにAIツール向けの指示文を作成できるよう支援します。AIがコードとどのようにやり取りするかを改善し、特定された不足点を解消するのに役立ちます。
acreadiness-policy
40kエージェントが、AIプロジェクトの評価ポリシーの策定や適用を支援できるようにします。プロジェクトの評価方法を標準化し、コンプライアンスを確保するのに役立ちます。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。