terraform-azurerm-set-diff-analyzer

Analyzes Terraform plan JSON to separate AzureRM Set ordering noise from real changes.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/serpro-workshop-fortaleza/sifap-modernization-paula --skill terraform-azurerm-set-diff-analyzer-serpro-workshop-fortaleza
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-azurerm-set-diff-analyzer
Source: https://github.com/serpro-workshop-fortaleza/sifap-modernization-paula/tree/main/.github/skills/terraform-azurerm-set-diff-analyzer
Command: npx skills add https://github.com/serpro-workshop-fortaleza/sifap-modernization-paula --skill terraform-azurerm-set-diff-analyzer-serpro-workshop-fortaleza

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Terraform plans for AzureRM resources often show dozens of changes when you only added or removed one element, because Set-type attributes compare elements by position rather than a stable key. This Skill classifies each diff as a false positive (order-only) or a real change so plan reviews and CI gates stay accurate. ## Core Features & Use Cases - False-positive detection: Identifies order-only diffs in Set attributes of Application Gateway, Load Balancer, Firewall, Front Door, NSG, and other AzureRM resources. - CI/CD integration: Offers markdown, JSON, and summary output formats plus severity-based exit codes (0-3) for pipeline gating in GitHub Actions or Azure Pipelines. - Nested Set analysis: Recursively analyzes nested Set structures like rewrite_rule_set and rule collections using a configurable attribute definition file. - Use Case: You add one NSG rule and the plan shows every rule as changed. Run the analyzer on the plan JSON to confirm only one real addition exists and safely ignore the ordering noise in your pull request. ## Quick Start Run terraform show -json on your plan file and pipe it into scripts/analyze_plan.py to get a classified diff report.

Frequently Asked Questions about terraform-azurerm-set-diff-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I filter false positive diffs in a Terraform plan?

Export the plan with terraform show -json and run analyze_plan.py on the JSON output. The script classifies each AzureRM Set attribute change as order-only (false positive) or a real addition, removal, or modification.

Why does terraform plan show all elements changed after adding one NSG rule?

Terraform Set-type attributes compare elements by position, not by a stable key, so inserting one element shifts every other element's index. This produces order-only diffs that do not change the deployed resource.

Which AzureRM resources does the Set diff analyzer support?

Supported resources include azurerm_application_gateway, azurerm_lb, azurerm_firewall, azurerm_firewall_policy_rule_collection_group, azurerm_frontdoor, azurerm_network_security_group, azurerm_virtual_network, and others defined in references/azurerm_set_attributes.json.

Can I use the analyzer in GitHub Actions or Azure Pipelines?

Yes, run analyze_plan.py with --format markdown to post results as a pull request comment, or use --exit-code to fail the pipeline on real Set changes (exit 1) or resource replacement (exit 2).

What are the limitations of Terraform Set diff analysis?

Only azurerm_* resources are supported, and comparisons may be incomplete for attributes containing after_unknown values or sensitive values that are masked in the plan JSON. Unsupported resources require manual review.

Does analyze_plan.py require any Python packages?

No third-party packages are needed. The script uses only the Python 3.8+ standard library, so it runs in any environment with Python installed.