--- title: "asciidoc table" description: "Generate AsciiDoc tables of inputs and outputs" menu: docs: parent: "asciidoc" weight: 953 toc: true --- ## Synopsis Generate AsciiDoc tables of inputs and outputs. ```console terraform-docs asciidoc table [PATH] [flags] ``` ## Options ```console -h, --help help for table ``` ## Inherited Options ```console --anchor create anchor links (default true) -c, --config string config file name (default ".terraform-docs.yml") --default show Default column or section (default true) --footer-from string relative path of a file to read footer from (default "") --header-from string relative path of a file to read header from (default "main.tf") --hide strings hide section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --hide-empty hide empty sections (default false) --indent int indention level of AsciiDoc sections [1, 2, 3, 4, 5] (default 2) --lockfile read .terraform.lock.hcl if exist (default true) --output-check check if content of output file is up to date (default false) --output-file string file path to insert output into (default "") --output-mode string output to file method [inject, replace] (default "inject") --output-template string output template (default "\n{{ .Content }}\n") --output-values inject output values into outputs (default false) --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --required show Required column or section (default true) --sensitive show Sensitive column or section (default true) --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) --sort-by string sort items by criteria [name, required, type] (default "name") --type show Type column or section (default true) ``` ## Example Given the [`examples`][examples] module: ```shell terraform-docs asciidoc table --footer-from footer.md ./examples/ ``` generates the following output: Usage: Example of 'foo_bar' module in `foo_bar.tf`. - list item 1 - list item 2 Even inline **formatting** in _here_ is possible. and some [link](https://domain.com/) * list item 3 * list item 4 ```hcl module "foo_bar" { source = "github.com/foo/bar" id = "1234567890" name = "baz" zones = ["us-east-1", "us-west-1"] tags = { Name = "baz" Created-By = "first.last@email.com" Date-Created = "20180101" } } ``` Here is some trailing text after code block, followed by another line of text. | Name | Description | |------|-----------------| | Foo | Foo description | | Bar | Bar description | == Requirements [cols="a,a",options="header,autowidth"] |=== |Name |Version |[[requirement_terraform]] <> |>= 0.12 |[[requirement_aws]] <> |>= 2.15.0 |[[requirement_foo]] <> |>= 1.0 |[[requirement_random]] <> |>= 2.2.0 |=== == Providers [cols="a,a",options="header,autowidth"] |=== |Name |Version |[[provider_aws]] <> |>= 2.15.0 |[[provider_aws.ident]] <> |>= 2.15.0 |[[provider_foo]] <> |>= 1.0 |[[provider_null]] <> |n/a |[[provider_tls]] <> |n/a |=== == Modules [cols="a,a,a",options="header,autowidth"] |=== |Name |Source |Version |[[module_bar]] <> |baz |4.5.6 |[[module_baz]] <> |baz |4.5.6 |[[module_foo]] <> |bar |1.2.3 |[[module_foobar]] <> |git@github.com:module/path |v7.8.9 |=== == Resources [cols="a,a",options="header,autowidth"] |=== |Name |Type |foo_resource.baz |resource |https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.foo] |resource |https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key[tls_private_key.baz] |resource |https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.current] |data source |https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity[aws_caller_identity.ident] |data source |=== == Inputs [cols="a,a,a,a,a",options="header,autowidth"] |=== |Name |Description |Type |Default |Required |[[input_bool-1]] <> |It's bool number one. |`bool` |`true` |no |[[input_bool-2]] <> |It's bool number two. |`bool` |`false` |no |[[input_bool-3]] <> |n/a |`bool` |`true` |no |[[input_bool_default_false]] <> |n/a |`bool` |`false` |no |[[input_input-with-code-block]] <> |This is a complicated one. We need a newline. And an example in a code block [source] ---- default = [ "machine rack01:neptune" ] ---- |`list` | [source] ---- [ "name rack:location" ] ---- |no |[[input_input-with-pipe]] <> |It includes v1 \| v2 \| v3 |`string` |`"v1"` |no |[[input_input_with_underscores]] <> |A variable with underscores. |`any` |n/a |yes |[[input_list-1]] <> |It's list number one. |`list` | [source] ---- [ "a", "b", "c" ] ---- |no |[[input_list-2]] <> |It's list number two. |`list` |n/a |yes |[[input_list-3]] <> |n/a |`list` |`[]` |no |[[input_list_default_empty]] <> |n/a |`list(string)` |`[]` |no |[[input_long_type]] <> |This description is itself markdown. It spans over multiple lines. | [source] ---- object({ name = string, foo = object({ foo = string, bar = string }), bar = object({ foo = string, bar = string }), fizz = list(string), buzz = list(string) }) ---- | [source] ---- { "bar": { "bar": "bar", "foo": "bar" }, "buzz": [ "fizz", "buzz" ], "fizz": [], "foo": { "bar": "foo", "foo": "foo" }, "name": "hello" } ---- |no |[[input_map-1]] <> |It's map number one. |`map` | [source] ---- { "a": 1, "b": 2, "c": 3 } ---- |no |[[input_map-2]] <> |It's map number two. |`map` |n/a |yes |[[input_map-3]] <> |n/a |`map` |`{}` |no |[[input_no-escape-default-value]] <> |The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. |`string` |`"VALUE_WITH_UNDERSCORE"` |no |[[input_number-1]] <> |It's number number one. |`number` |`42` |no |[[input_number-2]] <> |It's number number two. |`number` |n/a |yes |[[input_number-3]] <> |n/a |`number` |`"19"` |no |[[input_number-4]] <> |n/a |`number` |`15.75` |no |[[input_number_default_zero]] <> |n/a |`number` |`0` |no |[[input_object_default_empty]] <> |n/a |`object({})` |`{}` |no |[[input_string-1]] <> |It's string number one. |`string` |`"bar"` |no |[[input_string-2]] <> |It's string number two. |`string` |n/a |yes |[[input_string-3]] <> |n/a |`string` |`""` |no |[[input_string-special-chars]] <> |n/a |`string` |`"\\.<>[]{}_-"` |no |[[input_string_default_empty]] <> |n/a |`string` |`""` |no |[[input_string_default_null]] <> |n/a |`string` |`null` |no |[[input_string_no_default]] <> |n/a |`string` |n/a |yes |[[input_unquoted]] <> |n/a |`any` |n/a |yes |[[input_with-url]] <> |The description contains url. https://www.domain.com/foo/bar_baz.html |`string` |`""` |no |=== == Outputs [cols="a,a",options="header,autowidth"] |=== |Name |Description |[[output_output-0.12]] <> |terraform 0.12 only |[[output_output-1]] <> |It's output number one. |[[output_output-2]] <> |It's output number two. |[[output_unquoted]] <> |It's unquoted output. |=== ## This is an example of a footer It looks exactly like a header, but is placed at the end of the document [examples]: https://github.com/terraform-docs/terraform-docs/tree/master/examples