
A quick utility for analysing a Terraform directory and outputting Github flavoured Markdown documentation for input and output variables.
The tool can be used to verify the existence of description fields on all input and output variables before outputting (-verify
).
Additionally, if a source Markdown file is provided (-source <file>
) then the full file will be formatted before being output, with any existing "Inputs/Outputs" section replaced or otherwise appended.
Libraries 👏
Usage
Usage of ./terraform-documenter:
-dir string
the Terraform directory to analyse (default ".")
-source string
path to optional source Markdown file
-verify
verify presence of input/output variable descriptions
Git Hooks
terraform-documenter
is best used in combination with Git hook scripts to enforce standards across Terraform module repositories.
The terraform
command itself has useful in-built linting (terraform validate
) and formatting (terraform fmt
).
Terraform repository with hooks and lots of issues:

Terraform repository with hooks and issues gradually fixed:
