For Terraform and OpenTofu

Read the architecturebefore you apply it.

Rootform works out where your resources sit, what they connect to and why. Explore, compare, check.

curl -fsSL https://rootform.dev/install | sh
Open the Playground
  • Works offline
  • Never runs Terraform
  • Free, no account
~/commerce-platform
$ rootform run base.json --diff head.json -o comparison.json
Loading    base.json (saved Form; no recompilation)
Loading    head.json (saved Form; no recompilation)
Comparing  Before Planned (base.json) -> After Planned (head.json)
Wrote      comparison.json
Inputs compared
[58 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
~/commerce-platform
$ rootform check comparison.json --policy-pack ./policies
Using baseline 0.1.0 from ./policies for this command only
Selected   2 Policies from 1 Policy Pack
Loading    comparison.json (saved Form; no recompilation)
Evaluating 2 Policies against Before (Planned) and After (Planned)
Policy check completed
[12 more lines]
Verdict          PASSED    PASSED

Overall verdict  PASSED
Replace legacy webhooks

order-notificationsmain

Checks are running

1 check in progress

Rootform review Running
~/commerce-platform
$ rootform run base.json --diff head.json -o comparison.json
Loading    base.json (saved Form; no recompilation)
Loading    head.json (saved Form; no recompilation)
Comparing  Before Planned (base.json) -> After Planned (head.json)
Wrote      comparison.json
Inputs compared
[58 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
~/commerce-platform
$ rootform check comparison.json --policy-pack ./policies
Using baseline 0.1.0 from ./policies for this command only
Selected   2 Policies from 1 Policy Pack
Loading    comparison.json (saved Form; no recompilation)
Evaluating 2 Policies against Before (Planned) and After (Planned)
Policy check completed
[12 more lines]
Verdict          PASSED    PASSED

Overall verdict  PASSED
~/commerce-platform
$ rootform run base.json --diff head.json -o comparison.json
Loading    base.json (saved Form; no recompilation)
Loading    head.json (saved Form; no recompilation)
Comparing  Before Planned (base.json) -> After Planned (head.json)
Wrote      comparison.json
Inputs compared
[58 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
~/commerce-platform
$ rootform check comparison.json --policy-pack ./policies
Using baseline 0.1.0 from ./policies for this command only
Selected   2 Policies from 1 Policy Pack
Loading    comparison.json (saved Form; no recompilation)
Evaluating 2 Policies against Before (Planned) and After (Planned)
Policy check completed
[12 more lines]
Verdict          PASSED    PASSED

Overall verdict  PASSED
~/commerce-platform
$ rootform run base.json --diff head.json -o comparison.json
Loading    base.json (saved Form; no recompilation)
Loading    head.json (saved Form; no recompilation)
Comparing  Before Planned (base.json) -> After Planned (head.json)
Wrote      comparison.json
Inputs compared
[58 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
~/commerce-platform
$ rootform check comparison.json --policy-pack ./policies
Using baseline 0.1.0 from ./policies for this command only
Selected   2 Policies from 1 Policy Pack
Loading    comparison.json (saved Form; no recompilation)
Evaluating 2 Policies against Before (Planned) and After (Planned)
Policy check completed
[12 more lines]
Verdict          PASSED    PASSED

Overall verdict  PASSED
Replace legacy webhooks

order-notificationsmain

Checks are running

1 check in progress

Rootform review Running
  • Explorer

Stop piecing together the architecture in your head.

A plan shows resource changes. What they mean for the architecture, and for your team's rules, is still on you.

Once the cluster moves, what still reports to the prod workspace?

The plan says

Plan excerpt: azurerm_kubernetes_cluster.prod will be updated in-place, its oms_agent log_analytics_workspace_id changing from the workspace log-commerce-prod to a value known after apply; azurerm_log_analytics_workspace.platform will be created. Plan: 2 to add, 2 to change, 4 to destroy.

Rootform shows Planned changesRefreshed → Planned

Application Insights still reports to prod. It isn't changing, so the plan doesn't list it.

prodApplication Insights

Present in both, showing Planned

Observed by prodLog Analytics workspace

Rule
azure.rule.application-insights
Via
source.workspace_id
Match
id (exact)
Evidence
Evaluated value and verified traversal
  • Local and read-only

    No credentials, no state locks. It never executes a provider or calls your cloud.

  • Every fact cites its Rule

    Placements and connections come from Rules, never from depends_on alone.

  • Nothing is guessed

    What the evidence can't settle stays indeterminate, with the reason.

  • A Form you keep

    One JSON file to reopen, compare or check later, without attribute values.

  • Terminal
  • Explorer

Ask the plan why.

Pipe in a plan. Ask any resource where it sits, and why.

Given the same plan, Rootform writes the same Form, byte for byte, so your terminal, the Explorer and the pull request read the same facts.

Explain an architecture
http://127.0.0.1:21717
The Explorer served by rootform run form.json, on Planned changes: the data resource group with the PostgreSQL flexible server prod selected, present in both revisions, and the Inspector on Evidence: placed in the prod_postgres subnet by azure.rule.postgresql-flexible-server through source.delegated_subnet_id. The Explorer served by rootform run form.json, on Planned changes: the data resource group with the PostgreSQL flexible server prod selected, present in both revisions, and the Inspector on Evidence: placed in the prod_postgres subnet by azure.rule.postgresql-flexible-server through source.delegated_subnet_id.
~/commerce-platform
$ terraform show -json plan.tfplan | rootform run - --plan-file plan.tfplan --no-serve -o form.json
Compiling  standard input (plan JSON)
Enriched   saved plan paired with this plan JSON (1 module)
Wrote      form.json
Plan analyzed
[7 more lines]
Architecture
  Instances      97
  Interpreted    97
  Relations      15
  Contexts       110
  Contributions  37

Planned changes
  Refreshed -> Planned

  Instances      1 added, 3 removed, 1 planned for replacement
  Relations      1 added, 2 removed
  Contexts       1 added, 5 removed
  Contributions  1 added, 1 removed
[48 more lines]
~/commerce-platform
$ rootform explain instance azurerm_postgresql_flexible_server.prod --input form.json
Loading    form.json (saved Form; no recompilation)
Instance explained

Input  form.json
Stage  Planned

azurerm_postgresql_flexible_server.prod
  Instance        managed instance of azurerm_postgresql_flexible_server; planned (no-op)
  Provider        registry.terraform.io/hashicorp/azurerm
  Interpretation  applied azure.rule.postgresql-flexible-server as managed-database
[19 more lines]
  Closures
    context network -> subnet
      via source.delegated_subnet_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 7 excluded

    relation private-name-resolution -> dns-zone
      via source.private_dns_zone_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 6 excluded
[4 more lines]
~/commerce-platform
$ rootform run form.json
Loading    form.json (saved Form; no recompilation)
Form loaded

Input              form.json
Form               Plan, saved by rootform 0.2.1
[69 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
~/commerce-platform
$ terraform show -json plan.tfplan | rootform run - --plan-file plan.tfplan --no-serve -o form.json
Compiling  standard input (plan JSON)
Enriched   saved plan paired with this plan JSON (1 module)
Wrote      form.json
Plan analyzed
[7 more lines]
Architecture
  Instances      97
  Interpreted    97
  Relations      15
  Contexts       110
  Contributions  37

Planned changes
  Refreshed -> Planned

  Instances      1 added, 3 removed, 1 planned for replacement
  Relations      1 added, 2 removed
  Contexts       1 added, 5 removed
  Contributions  1 added, 1 removed
[48 more lines]
~/commerce-platform
$ rootform explain instance azurerm_postgresql_flexible_server.prod --input form.json
Loading    form.json (saved Form; no recompilation)
Instance explained

Input  form.json
Stage  Planned

azurerm_postgresql_flexible_server.prod
  Instance        managed instance of azurerm_postgresql_flexible_server; planned (no-op)
  Provider        registry.terraform.io/hashicorp/azurerm
  Interpretation  applied azure.rule.postgresql-flexible-server as managed-database
[19 more lines]
  Closures
    context network -> subnet
      via source.delegated_subnet_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 7 excluded

    relation private-name-resolution -> dns-zone
      via source.private_dns_zone_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 6 excluded
[4 more lines]
~/commerce-platform
$ rootform run form.json
Loading    form.json (saved Form; no recompilation)
Form loaded

Input              form.json
Form               Plan, saved by rootform 0.2.1
[69 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
~/commerce-platform
$ terraform show -json plan.tfplan | rootform run - --plan-file plan.tfplan --no-serve -o form.json
Compiling  standard input (plan JSON)
Enriched   saved plan paired with this plan JSON (1 module)
Wrote      form.json
Plan analyzed
[7 more lines]
Architecture
  Instances      97
  Interpreted    97
  Relations      15
  Contexts       110
  Contributions  37

Planned changes
  Refreshed -> Planned

  Instances      1 added, 3 removed, 1 planned for replacement
  Relations      1 added, 2 removed
  Contexts       1 added, 5 removed
  Contributions  1 added, 1 removed
[48 more lines]
~/commerce-platform
$ rootform explain instance azurerm_postgresql_flexible_server.prod --input form.json
Loading    form.json (saved Form; no recompilation)
Instance explained

Input  form.json
Stage  Planned

azurerm_postgresql_flexible_server.prod
  Instance        managed instance of azurerm_postgresql_flexible_server; planned (no-op)
  Provider        registry.terraform.io/hashicorp/azurerm
  Interpretation  applied azure.rule.postgresql-flexible-server as managed-database
[19 more lines]
  Closures
    context network -> subnet
      via source.delegated_subnet_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 7 excluded

    relation private-name-resolution -> dns-zone
      via source.private_dns_zone_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 6 excluded
[4 more lines]
~/commerce-platform
$ rootform run form.json
Loading    form.json (saved Form; no recompilation)
Form loaded

Input              form.json
Form               Plan, saved by rootform 0.2.1
[69 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
~/commerce-platform
$ terraform show -json plan.tfplan | rootform run - --plan-file plan.tfplan --no-serve -o form.json
Compiling  standard input (plan JSON)
Enriched   saved plan paired with this plan JSON (1 module)
Wrote      form.json
Plan analyzed
[7 more lines]
Architecture
  Instances      97
  Interpreted    97
  Relations      15
  Contexts       110
  Contributions  37

Planned changes
  Refreshed -> Planned

  Instances      1 added, 3 removed, 1 planned for replacement
  Relations      1 added, 2 removed
  Contexts       1 added, 5 removed
  Contributions  1 added, 1 removed
[48 more lines]
~/commerce-platform
$ rootform explain instance azurerm_postgresql_flexible_server.prod --input form.json
Loading    form.json (saved Form; no recompilation)
Instance explained

Input  form.json
Stage  Planned

azurerm_postgresql_flexible_server.prod
  Instance        managed instance of azurerm_postgresql_flexible_server; planned (no-op)
  Provider        registry.terraform.io/hashicorp/azurerm
  Interpretation  applied azure.rule.postgresql-flexible-server as managed-database
[19 more lines]
  Closures
    context network -> subnet
      via source.delegated_subnet_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 7 excluded

    relation private-name-resolution -> dns-zone
      via source.private_dns_zone_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 6 excluded
[4 more lines]
~/commerce-platform
$ rootform run form.json
Loading    form.json (saved Form; no recompilation)
Form loaded

Input              form.json
Form               Plan, saved by rootform 0.2.1
[69 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
~/commerce-platform
$ terraform show -json plan.tfplan | rootform run - --plan-file plan.tfplan --no-serve -o form.json
Compiling  standard input (plan JSON)
Enriched   saved plan paired with this plan JSON (1 module)
Wrote      form.json
Plan analyzed
[7 more lines]
Architecture
  Instances      97
  Interpreted    97
  Relations      15
  Contexts       110
  Contributions  37

Planned changes
  Refreshed -> Planned

  Instances      1 added, 3 removed, 1 planned for replacement
  Relations      1 added, 2 removed
  Contexts       1 added, 5 removed
  Contributions  1 added, 1 removed
[48 more lines]
~/commerce-platform
$ rootform explain instance azurerm_postgresql_flexible_server.prod --input form.json
Loading    form.json (saved Form; no recompilation)
Instance explained

Input  form.json
Stage  Planned

azurerm_postgresql_flexible_server.prod
  Instance        managed instance of azurerm_postgresql_flexible_server; planned (no-op)
  Provider        registry.terraform.io/hashicorp/azurerm
  Interpretation  applied azure.rule.postgresql-flexible-server as managed-database
[19 more lines]
  Closures
    context network -> subnet
      via source.delegated_subnet_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 7 excluded

    relation private-name-resolution -> dns-zone
      via source.private_dns_zone_id, match exact by id
      resolved, 1 fact; candidates: 1 known equal, 0 unknown, 6 excluded
[4 more lines]
~/commerce-platform
$ rootform run form.json
Loading    form.json (saved Form; no recompilation)
Form loaded

Input              form.json
Form               Plan, saved by rootform 0.2.1
[69 more lines]
Explorer
  http://127.0.0.1:21717/

  Press Ctrl+C to stop.
http://127.0.0.1:21717
The Explorer served by rootform run form.json, on Planned changes: the data resource group with the PostgreSQL flexible server prod selected, present in both revisions, and the Inspector on Evidence: placed in the prod_postgres subnet by azure.rule.postgresql-flexible-server through source.delegated_subnet_id. The Explorer served by rootform run form.json, on Planned changes: the data resource group with the PostgreSQL flexible server prod selected, present in both revisions, and the Inspector on Evidence: placed in the prod_postgres subnet by azure.rule.postgresql-flexible-server through source.delegated_subnet_id.
  • Check
  • CI
  • Pull request

Write a Policy once. Check every plan.

Concepts let one file work across providers. Every verdict comes with its evidence.

  • aws_db_instance
  • google_sql_database_instance
  • mongodbatlas_advanced_cluster
  • azurerm_postgresql_flexible_server
  • snowflake_postgres_instance
  • databricks_database_instance
  • cloudflare_d1_database

27 Rules in seven Dialects map to this Concept.

policies/managed-database-network-context.rf.hcl Policy Pack baseline
policy "managed-database-network-context" {  target {    concept = rf.concept.managed-database  }
assert = ( exists(contexts(rf.context.network, rf.concept.virtual-network)) || exists(contexts(rf.context.network, rf.concept.subnet)) )
message = "Managed databases must belong to a network context."}
  • Target a Concept

    One target reaches every type the Dialects map to it.

  • Assert on evidence

    It passes only when the evidence places the database in a virtual network or a subnet.

  • Say what it requires

    Reviewers read this requirement in the pull request.

policies/managed-database-network-context.rf.hcl Policy Pack baseline
policy "managed-database-network-context" {  target {    concept = rf.concept.managed-database  }
assert = ( exists(contexts(rf.context.network, rf.concept.virtual-network)) || exists(contexts(rf.context.network, rf.concept.subnet)) )
message = "Managed databases must belong to a network context."}
  • Target a Concept Lines 2–4

    One target reaches every type the Dialects map to it.

    • aws_db_instance
    • google_sql_database_instance
    • mongodbatlas_advanced_cluster
    • azurerm_postgresql_flexible_server
    • snowflake_postgres_instance
    • databricks_database_instance
    • cloudflare_d1_database

    27 Rules in seven Dialects map to this Concept.

  • Assert on evidence Lines 6–9

    It passes only when the evidence places the database in a virtual network or a subnet.

  • Say what it requires Line 11

    Reviewers read this requirement in the pull request.

  • PASSED exit0

    The evidence proves the assertion.

  • VIOLATED exit1

    The evidence proves it false.

  • INDETERMINATE exit3

    The evidence can't decide. It never counts as a pass.

Check a plan, a state, or both sides of a comparison. Write a Policy Pack

Runs where your plan already is.

One step after terraform plan.

GitLab, Azure Pipelines or any shell
.github/workflows/plan.yml
- run: terraform plan -out plan.tfplan- run: terraform show -json plan.tfplan > plan.json- uses: rootform-dev/action@v1  with:    version: 0.3.0    input: plan.json    plan-file: plan.tfplan    policy-pack: ./policies    comment: true
  • Pull request comment
  • Job Summary
  • Artifact with explorer.html
  • Check status

github-actionsbotcommented

Rootform

Policies

Verdict: PASSED

Planned architecture

2 Policies selected. 2 evaluations passed.

1 more Policy

Passed Policy details

baseline.policy.managed-database-network-context

Requirement: Managed databases must belong to a network context.

Passed: 1 evaluation

  • azurerm_postgresql_flexible_server.prod: The network context toward subnet through source.delegated_subnet_id (match exact by id) resolved to azurerm_subnet.prod_postgres (evidence: both).
  • Drift

What the state records. What the plan restores.

Read drift as architecture, and see what the plan puts back.

Your plan already holds three moments. Rootform compares each pair, so drift the plan reverts cancels out of the net change and reviewers see only what remains.

How comparisons work
  1. Recorded

    What the state recorded, before refresh.

  2. Refreshed

    What refresh found. The plan starts from here.

  3. Planned

    What the plan proposes, before anything is applied.

restored-drift
~/restored-drift
$ terraform show -json plan.tfplan | rootform run -
Compiling  standard input (plan JSON)
Plan analyzed
[21 more lines]
Reported drift
  Recorded -> Refreshed
  The export does not establish the refresh scope.

  Drift entries  1 (1 architectural)
  Effect         1 fact added, 1 removed

  ~ aws_kms_alias.app  changes the architecture; 2 fact changes
restored-drift
~/restored-drift
$ terraform show -json plan.tfplan | rootform run -
Compiling  standard input (plan JSON)
Plan analyzed
[11 more lines]
Planned changes
  Refreshed -> Planned

  Contributions           1 added, 1 removed
  Indeterminate closures  0

  Contributions
    + aws_kms_alias.app  contribution -> aws_kms_key.primary  added
    - aws_kms_alias.app  contribution -> aws_kms_key.standby  removed
restored-drift
~/restored-drift
$ terraform show -json plan.tfplan | rootform run -
Compiling  standard input (plan JSON)
Plan analyzed
[30 more lines]
Net change
  Recorded -> Planned

  No net architectural difference: the plan proposes to restore 2 drift fact
  changes.

  Cancelled
    = aws_kms_alias.app  removed by drift, planned for restoration
        contribution -> aws_kms_key.primary
    = aws_kms_alias.app  added by drift, planned for removal
        contribution -> aws_kms_key.standby
restored-drift
~/restored-drift
$ terraform show -json plan.tfplan | rootform run -
Compiling  standard input (plan JSON)
Plan analyzed
[21 more lines]
Reported drift
  Recorded -> Refreshed
  The export does not establish the refresh scope.

  Drift entries  1 (1 architectural)
  Effect         1 fact added, 1 removed

  ~ aws_kms_alias.app  changes the architecture; 2 fact changes
restored-drift
~/restored-drift
$ terraform show -json plan.tfplan | rootform run -
Compiling  standard input (plan JSON)
Plan analyzed
[21 more lines]
Reported drift
  Recorded -> Refreshed
  The export does not establish the refresh scope.

  Drift entries  1 (1 architectural)
  Effect         1 fact added, 1 removed

  ~ aws_kms_alias.app  changes the architecture; 2 fact changes
restored-drift
~/restored-drift
$ terraform show -json plan.tfplan | rootform run -
Compiling  standard input (plan JSON)
Plan analyzed
[11 more lines]
Planned changes
  Refreshed -> Planned

  Contributions           1 added, 1 removed
  Indeterminate closures  0

  Contributions
    + aws_kms_alias.app  contribution -> aws_kms_key.primary  added
    - aws_kms_alias.app  contribution -> aws_kms_key.standby  removed
restored-drift
~/restored-drift
$ terraform show -json plan.tfplan | rootform run -
Compiling  standard input (plan JSON)
Plan analyzed
[30 more lines]
Net change
  Recorded -> Planned

  No net architectural difference: the plan proposes to restore 2 drift fact
  changes.

  Cancelled
    = aws_kms_alias.app  removed by drift, planned for restoration
        contribution -> aws_kms_key.primary
    = aws_kms_alias.app  added by drift, planned for removal
        contribution -> aws_kms_key.standby
restored-drift
~/restored-drift
$ terraform show -json plan.tfplan | rootform run -
Compiling  standard input (plan JSON)
Plan analyzed
[21 more lines]
Reported drift
  Recorded -> Refreshed
  The export does not establish the refresh scope.

  Drift entries  1 (1 architectural)
  Effect         1 fact added, 1 removed

  ~ aws_kms_alias.app  changes the architecture; 2 fact changes
  • Dialects

18 Dialects. 1,912 Rules.

From AWS to Vault, every Rule is plain .rf.hcl you can read, extend or replace.

The official Dialects ship inside the binary and work without setup. A Form records the exact Rules it used, so reopening it later never reinterprets it with newer ones.

Reads
TerraformOpenTofu
Edits with
VS CodeZed
Runs on
macOSLinuxWindowsContainer
Write your own Dialect

What people ask first.

Another question? Ask the community

A Terraform or OpenTofu plan or state JSON export. For plans, pairing the saved plan gives Rootform the strongest evidence.

No. Rootform analyzes it where you run it, with no telemetry. It never runs Terraform or contacts your cloud, and the Form does not retain attribute values. In CI, the Action's artifact keeps the Form and its reports, never the raw plan or state.

No. Keep producing plans and state as you already do. Rootform reads the exported result and fits alongside your existing local and CI workflows.

A dependency graph shows references. Rootform derives architectural placements and connections through Dialect Rules, and keeps the evidence behind each fact. What it can't establish stays indeterminate.

Yes. No account is required. The CLI, Explorer, Policy checks and GitHub Action are free and will remain free. Rootform Cloud is also in preparation as an optional hosted offering.

Start from the export you already have.

Install Rootform, point it at a plan, and read what it builds.

# Install on Linux

curl -fsSL https://rootform.dev/install | sh

# Verify

rootform version