Recursive Submodules

Since v0.15.0

Considering the file strucutre below of main module and its submodules, it is possible to generate documentation for them main and all its submodules in one execution, with --recursive flag.

Path to find submodules can be configured with --recursive-path (defaults to modules).

Each submodule can also have their own .terraform-docs.yml config file, to override configuration from root module.

$ pwd
/path/to/module

$ tree .
.
├── README.md
├── main.tf
├── modules
│   └── my-sub-module
│       ├── README.md
│       ├── main.tf
│       ├── variables.tf
│       └── versions.tf
├── outputs.tf
├── variables.tf
└── versions.tf

Edit on GitHub