Use Terraform pre-commit hooks to make sure that the code is valid, properly formatted and automatically documented before it is pushed to git and reviewed by human.
Automatically generated documentation
pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. It is written in Python and is a powerful tool to do something automatically on developer's machine before code is committed to git repository. Normally, it is used run linters and format code (see supported hooks).
With Terraform configurations pre-commit can be used to format and validate code, as well as to update documentation.
terraform-docs is a tool which does generation of documentation from Terraform modules in various output formats. You can run it manually (without pre-commit hooks), or using pre-commit-terraform hooks to get documentation updated automatically.