Automatic Module Grouping

Resources are automatically organized by Terraform module, making it easy to understand changes in complex multi-module configurations.

all providers

Large Terraform plans often contain hundreds of resources scattered across multiple modules. tfplan2md automatically groups these resources by their module path, providing a structured and hierarchical view of changes.

❌ Without tfplan2md

Raw Terraform Output
# azurerm_resource_group.core will be created
+ resource "azurerm_resource_group" "core" {
    + id       = (known after apply)
    + location = "eastus"
    + name     = "rg-tfplan2md-demo"
  }

# module.network.azurerm_virtual_network.hub will be created
+ resource "azurerm_virtual_network" "hub" {
    + address_space       = ["10.0.0.0/16"]
    + id                  = (known after apply)
    + location            = "eastus"
    + name                = "vnet-hub"
  }

# module.security.azurerm_role_assignment.rg_reader will be created
+ resource "azurerm_role_assignment" "rg_reader" {
    + id                   = (known after apply)
    + principal_id         = "00000000-0000-0000-0000-000000000001"
    + principal_type       = "User"
    + role_definition_name = "Reader"
    + scope                = "/subscriptions/.../resourceGroups/rg-tfplan2md-demo"
  }

# module.network.azurerm_virtual_network.spoke will be created
+ resource "azurerm_virtual_network" "spoke" {
    + address_space       = ["10.1.0.0/16"]
    + id                  = (known after apply)
  }

Resources from different modules are intermixedβ€”hard to see structure.

βœ… With tfplan2md

Module-Grouped Output

πŸ“¦ Module: root

βž• azurerm_resource_group core β€” πŸ†” rg-tfplan2md-demo 🌍 eastus ...

πŸ“¦ Module: module.network

βž• azurerm_virtual_network hub β€” πŸ†” vnet-hub 🌐 10.0.0.0/16 ...
βž• azurerm_virtual_network spoke β€” πŸ†” vnet-spoke 🌐 10.1.0.0/16 ...

πŸ“¦ Module: module.security

βž• azurerm_role_assignment rg_reader β€” πŸ‘€ User β†’ πŸ›‘οΈ Reader on rg-tfplan2md-demo ...
### πŸ“¦ Module: root

<details>
<summary>βž• azurerm_resource_group <b><code>core</code></b> β€” <code>πŸ†” rg-tfplan2md-demo</code> <code>🌍 eastus</code></summary>
...
</details>

---

### πŸ“¦ Module: `module.network`

<details>
<summary>βž• azurerm_virtual_network <b><code>hub</code></b> β€” <code>πŸ†” vnet-hub</code> <code>🌐 10.0.0.0/16</code></summary>
...
</details>

<details>
<summary>βž• azurerm_virtual_network <b><code>spoke</code></b> β€” <code>πŸ†” vnet-spoke</code> <code>🌐 10.1.0.0/16</code></summary>
...
</details>

---

### πŸ“¦ Module: `module.security`

<details>
<summary>βž• azurerm_role_assignment <b><code>rg_reader</code></b> β€” <code>πŸ‘€ User</code> β†’ <code>πŸ›‘οΈ Reader</code> on <code>rg-tfplan2md-demo</code></summary>
...
</details>

Clear module separationβ€”each module's resources are grouped together.

Benefits

  • Root module appears first, followed by child modules in sorted order
  • Modules without changes are omitted for cleaner reports
  • Nested modules are shown flat but maintain hierarchical sort order
  • Enabled by defaultβ€”no configuration required

Learn More

Module grouping is automatically applied to all reports, organizing resources by their Terraform module hierarchy.