Document your Terraform module in seconds
A good module README is the difference between a reusable component and a black box. This builder produces a README in the well-known terraform-docs layout — description, requirements, providers, inputs and outputs tables, and a copy-paste usage example — so consumers know exactly how to call your module.
How it works
The generator renders standard GitHub-flavoured Markdown tables. The Inputs table lists each variable’s name, description, type, default, and whether it is required. A variable without a default is treated as required and shows n/a; an optional variable shows its default in backticks. The Outputs table pairs each output name with its description.
Cell values are escaped so a literal pipe character in a description does not break the table layout, and newlines are flattened to spaces. The Usage section emits a module block referencing your source and pre-fills only the required inputs with type-appropriate placeholders — numeric inputs get 1, everything else gets a quoted string.
Tips and notes
- Keep descriptions to a single clear sentence — they render in one table row.
- Document version constraints honestly: the lowest Terraform and provider versions you have actually tested against.
- Outputs are how other modules consume yours, so describe each one’s meaning, not just its name.
- Run
terraform-docsin CI to keep the README in sync as variables change; use this builder for the initial scaffold or for modules you author by hand.