mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 12:58:35 +07:00
Configuration can be loaded with `-c, --config string` which accepts
both relative and absolute paths.
$ pwd
/path/to/parent/folder
$ tree
.
├── module-a
│ └── main.tf
├── module-b
│ └── main.tf
├── ...
└── .terraform-docs.yml
# executing from parent
$ terraform-docs -c .terraform-docs.yml module-a/
# executing from child
$ cd module-a/
$ terraform-docs -c ../.terraform-docs.yml .
# or an absolute path
$ terraform-docs -c /path/to/parent/folder/.terraform-docs.yml .
The order for looking for config file is:
1. root of module directory
2. current directory
3. `$HOME/.tfdocs.d/`
if `.terraform-docs.yml` is found in any of the folders above, that will
take precedence and will override the other ones. Note that values passed
directly as CLI flags will override all of the above.
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>