v0.13.0
Notable Updates
The most notable changes in this release are:
-
Add support for Terraform v0.15 and
configuration_aliases
(thanks to @adamjohnson01) -
Add ability to show or hide data-sources (thanks to @edgarsandi)
-
Read
.terraform-docs.yml
from relative path, absolute path, or$HOME
(more info)# executing from parent $ terraform-docs -c .terraform-docs.yml module-a/ # executing from child $ cd module-a/ $ terraform-docs -c ../.terraform-docs.yml . # or an absolute path $ terraform-docs -c /path/to/parent/folder/.terraform-docs.yml .
-
Support outputing to file for absolute path (more info)
# this works, relative path $ terraform-docs markdown table --output-file ../docs/README.md . # so does this, absolute path $ terraform-docs markdown table --output-file /path/to/module/docs/README.md .
-
Version constraints configuration (more info)
# .terraform-docs.yml version: ">= 0.13.0, < 1.0.0"
Breaking Changes
-
We're no longer distributing standalone binaries. Only compressed files (either
tar.gz
orzip
) will be available to download from GitHub Release page. -
--sort-by-XX
flags are deprecated in favor of corresponding dynamic--sort-by XX
. Affected flags are:--sort-by-required
--sort-by-type
In return new
--sort-by string
is added with following values:name
(default)required
type
Note that the behavior of
--sort bool
was not changed and to disable sorting altogether you can run--sort false
.Note than the type of
sort.by
in.terraform-docs.yml
has been changed fromlist
tostring
sort: enabled: true by: required # this now only accepts string
-
Flags
--show-all
and--hide-all
are deprecated in favor of explicit use of--show
and--hide
.In other words when
--show <section>
is used, only<section>
will be shown. If you want to show multiple sections and hide the rest you can specify multiple--show
flags. The same logic is also applied to--hide
.# show 'inputs' and hide everything else $ terraform-docs --show inputs <formatter> # show 'inputs' and show 'outputs' and hide everything else $ terraform-docs --show inputs --show outputs <formatter> # hide 'header' and show everything else $ terraform-docs --hide header <formatter> # hide 'header' and hide 'providers' and show everything else $ terraform-docs --hide header --hide providers <formatter>
Note: Using
--show
or--hide
CLI flag will completely override the values from.terraform-docs.yml
. Example:$ cat .terraform-docs.yml sections: show: - inputs - outputs # example 1: this will only show 'providers' $ terraform-docs --show providers . # example 2: this will hide 'inputs' and hide 'providers' and show everything else $ terraform-docs --hide inputs --hide providers .
Changelog
Features
c8fc7ab add ability to show or hide data-sources
d914ca7 Add a flag for showing description with hcl formatted tfvars
a26111f Add support for configuration_aliases
fcd314b Read config from relative path, absolute, or $HOME
0eea133 Support inline comments variation for Markdown and AsciiDoc
845469c Support outputing to file for absolute path
dabf54f Version constraints configuration
Bug Fixes
4be2223 In output-mode inject do not fail if file not found
Refactoring
557d53d Deprecate '--sort-by-XX' in favor of '--sort-by XX'
8c531b6 Deprecate --show-all and --hide-all flags
40f9b9d Do not distribute standalone binaries
2ea8635 Remove unused build tools from dockerfile
Documentation
b4981a1 Add 'since version' to docs for clarity
1415ac9 Add Terraform compatibility matrix documentation
6b0cf54 Add document for 'false' value for CLI flag
2784920 Update doc to indicate minimum go1.16 is needed
Docker images
docker pull quay.io/terraform-docs/terraform-docs:latest
docker pull quay.io/terraform-docs/terraform-docs:0.13.0
Contributors
Very special thanks to the contributors.