A utility to generate documentation from Terraform modules in various output formats.
terraform-docs is a command-line utility that automatically generates documentation for Terraform modules. It extracts information from .tf files—such as variables, outputs, providers, and resources—and formats it into structured documentation. This solves the problem of outdated or missing documentation in infrastructure-as-code projects by keeping docs in sync with the actual Terraform configuration.
Terraform developers and DevOps engineers who manage infrastructure-as-code and need to maintain accurate, up-to-date module documentation for their teams or public modules.
Developers choose terraform-docs because it automates a tedious manual process, supports multiple output formats and integrations (like pre-commit hooks and GitHub Actions), and offers extensive customization through configuration files and plugins, making it highly adaptable to different documentation standards.
Generate documentation from Terraform modules in various output formats
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports six formats including Markdown, AsciiDoc, JSON, and YAML, allowing seamless integration into different documentation workflows as highlighted in the README.
Offers fine-grained control via .terraform-docs.yml configuration files and Go templates, enabling tailored documentation structure and content.
Can be run as a GitHub Action, pre-commit hook, or Docker container, automating documentation updates in development pipelines per the usage examples.
Includes a plugin system for creating custom output formatters, though it requires Go knowledge, as detailed in the plugin section.
Creating custom plugins involves setting up a Go repository and understanding the codebase, which can be a significant barrier for non-Go developers.
Solely designed for Terraform modules, making it unsuitable for documenting other infrastructure-as-code tools or general-purpose codebases.
The .terraform-docs.yml file has numerous options, and managing it across multiple modules can become verbose and time-consuming.