Generate Terraform module inputs and outputs docs with terraform-docs before review drift sets in
Refresh Terraform module documentation from source so variables, outputs, and providers stay aligned with the code before review or release.
Prerequisites
Terraform module directory, terraform-docs CLI, optional README template or CI step
Installation
Use the upstream install or setup path that matches your environment:
- brew install terraform-docs
- brew install terraform-docs/tap/terraform-docs
- go install github.com/terraform-docs/terraform-docs@v0.24.0
- the repo and run make build from the repository which will put terraform-docs in:
Requirements and caveats from upstream:
Using docker
- NOTE: Docker tag latest refers to latest stable released version and edge
Basic usage or getting-started notes:
macOS users can install using [Homebrew]:
bash
or
Extracted from upstream docs: https://raw.githubusercontent.com/terraform-docs/terraform-docs/HEAD/README.md