xml
Synopsis
Generate XML of inputs and outputs.
terraform-docs xml [PATH] [flags]
Options
-h, --help help for xml
Inherited Options
-c, --config string config file name (default ".terraform-docs.yml")
--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]
--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 "<!-- BEGIN_TF_DOCS -->\n{{ .Content }}\n<!-- END_TF_DOCS -->")
--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")
--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")
Example
Given the examples
module:
terraform-docs xml --footer-from footer.md ./examples/
generates the following output:
<module>
<header>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 |</header>
<footer>## This is an example of a footer

It looks exactly like a header, but is placed at the end of the document</footer>
<inputs>
<input>
<name>bool-1</name>
<type>bool</type>
<description>It's bool number one.</description>
<default>true</default>
<required>false</required>
</input>
<input>
<name>bool-2</name>
<type>bool</type>
<description>It's bool number two.</description>
<default>false</default>
<required>false</required>
</input>
<input>
<name>bool-3</name>
<type>bool</type>
<description xsi:nil="true"></description>
<default>true</default>
<required>false</required>
</input>
<input>
<name>bool_default_false</name>
<type>bool</type>
<description xsi:nil="true"></description>
<default>false</default>
<required>false</required>
</input>
<input>
<name>input-with-code-block</name>
<type>list</type>
<description>This is a complicated one. We need a newline. 
And an example in a code block
```
default = [
 "machine rack01:neptune"
]
```
</description>
<default>
<item>name rack:location</item>
</default>
<required>false</required>
</input>
<input>
<name>input-with-pipe</name>
<type>string</type>
<description>It includes v1 | v2 | v3</description>
<default>v1</default>
<required>false</required>
</input>
<input>
<name>input_with_underscores</name>
<type>any</type>
<description>A variable with underscores.</description>
<default xsi:nil="true"></default>
<required>true</required>
</input>
<input>
<name>list-1</name>
<type>list</type>
<description>It's list number one.</description>
<default>
<item>a</item>
<item>b</item>
<item>c</item>
</default>
<required>false</required>
</input>
<input>
<name>list-2</name>
<type>list</type>
<description>It's list number two.</description>
<default xsi:nil="true"></default>
<required>true</required>
</input>
<input>
<name>list-3</name>
<type>list</type>
<description xsi:nil="true"></description>
<default></default>
<required>false</required>
</input>
<input>
<name>list_default_empty</name>
<type>list(string)</type>
<description xsi:nil="true"></description>
<default></default>
<required>false</required>
</input>
<input>
<name>long_type</name>
<type>object({
 name = string,
 foo = object({ foo = string, bar = string }),
 bar = object({ foo = string, bar = string }),
 fizz = list(string),
 buzz = list(string)
 })</type>
<description>This description is itself markdown.

It spans over multiple lines.
</description>
<default>
<bar>
<bar>bar</bar>
<foo>bar</foo>
</bar>
<buzz>
<item>fizz</item>
<item>buzz</item>
</buzz>
<fizz></fizz>
<foo>
<bar>foo</bar>
<foo>foo</foo>
</foo>
<name>hello</name>
</default>
<required>false</required>
</input>
<input>
<name>map-1</name>
<type>map</type>
<description>It's map number one.</description>
<default>
<a>1</a>
<b>2</b>
<c>3</c>
</default>
<required>false</required>
</input>
<input>
<name>map-2</name>
<type>map</type>
<description>It's map number two.</description>
<default xsi:nil="true"></default>
<required>true</required>
</input>
<input>
<name>map-3</name>
<type>map</type>
<description xsi:nil="true"></description>
<default></default>
<required>false</required>
</input>
<input>
<name>no-escape-default-value</name>
<type>string</type>
<description>The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'.</description>
<default>VALUE_WITH_UNDERSCORE</default>
<required>false</required>
</input>
<input>
<name>number-1</name>
<type>number</type>
<description>It's number number one.</description>
<default>42</default>
<required>false</required>
</input>
<input>
<name>number-2</name>
<type>number</type>
<description>It's number number two.</description>
<default xsi:nil="true"></default>
<required>true</required>
</input>
<input>
<name>number-3</name>
<type>number</type>
<description xsi:nil="true"></description>
<default>19</default>
<required>false</required>
</input>
<input>
<name>number-4</name>
<type>number</type>
<description xsi:nil="true"></description>
<default>15.75</default>
<required>false</required>
</input>
<input>
<name>number_default_zero</name>
<type>number</type>
<description xsi:nil="true"></description>
<default>0</default>
<required>false</required>
</input>
<input>
<name>object_default_empty</name>
<type>object({})</type>
<description xsi:nil="true"></description>
<default></default>
<required>false</required>
</input>
<input>
<name>string-1</name>
<type>string</type>
<description>It's string number one.</description>
<default>bar</default>
<required>false</required>
</input>
<input>
<name>string-2</name>
<type>string</type>
<description>It's string number two.</description>
<default xsi:nil="true"></default>
<required>true</required>
</input>
<input>
<name>string-3</name>
<type>string</type>
<description xsi:nil="true"></description>
<default></default>
<required>false</required>
</input>
<input>
<name>string-special-chars</name>
<type>string</type>
<description xsi:nil="true"></description>
<default>\.<>[]{}_-</default>
<required>false</required>
</input>
<input>
<name>string_default_empty</name>
<type>string</type>
<description xsi:nil="true"></description>
<default></default>
<required>false</required>
</input>
<input>
<name>string_default_null</name>
<type>string</type>
<description xsi:nil="true"></description>
<default xsi:nil="true"></default>
<required>false</required>
</input>
<input>
<name>string_no_default</name>
<type>string</type>
<description xsi:nil="true"></description>
<default xsi:nil="true"></default>
<required>true</required>
</input>
<input>
<name>unquoted</name>
<type>any</type>
<description xsi:nil="true"></description>
<default xsi:nil="true"></default>
<required>true</required>
</input>
<input>
<name>with-url</name>
<type>string</type>
<description>The description contains url. https://www.domain.com/foo/bar_baz.html</description>
<default></default>
<required>false</required>
</input>
</inputs>
<modules>
<module>
<name>bar</name>
<source>baz</source>
<version>4.5.6</version>
<description xsi:nil="true"></description>
</module>
<module>
<name>baz</name>
<source>baz</source>
<version>4.5.6</version>
<description xsi:nil="true"></description>
</module>
<module>
<name>foo</name>
<source>bar</source>
<version>1.2.3</version>
<description>another type of description for module foo</description>
</module>
<module>
<name>foobar</name>
<source>git@github.com:module/path</source>
<version>v7.8.9</version>
<description xsi:nil="true"></description>
</module>
</modules>
<outputs>
<output>
<name>output-0.12</name>
<description>terraform 0.12 only</description>
</output>
<output>
<name>output-1</name>
<description>It's output number one.</description>
</output>
<output>
<name>output-2</name>
<description>It's output number two.</description>
</output>
<output>
<name>unquoted</name>
<description>It's unquoted output.</description>
</output>
</outputs>
<providers>
<provider>
<name>aws</name>
<alias xsi:nil="true"></alias>
<version>>= 2.15.0</version>
</provider>
<provider>
<name>aws</name>
<alias>ident</alias>
<version>>= 2.15.0</version>
</provider>
<provider>
<name>foo</name>
<alias xsi:nil="true"></alias>
<version>>= 1.0</version>
</provider>
<provider>
<name>null</name>
<alias xsi:nil="true"></alias>
<version xsi:nil="true"></version>
</provider>
<provider>
<name>tls</name>
<alias xsi:nil="true"></alias>
<version xsi:nil="true"></version>
</provider>
</providers>
<requirements>
<requirement>
<name>terraform</name>
<version>>= 0.12</version>
</requirement>
<requirement>
<name>aws</name>
<version>>= 2.15.0</version>
</requirement>
<requirement>
<name>foo</name>
<version>>= 1.0</version>
</requirement>
<requirement>
<name>random</name>
<version>>= 2.2.0</version>
</requirement>
</requirements>
<resources>
<resource>
<type>resource</type>
<name>baz</name>
<provider>foo</provider>
<source>https://registry.acme.com/foo</source>
<mode>managed</mode>
<version>latest</version>
<description xsi:nil="true"></description>
</resource>
<resource>
<type>resource</type>
<name>foo</name>
<provider>null</provider>
<source>hashicorp/null</source>
<mode>managed</mode>
<version>latest</version>
<description xsi:nil="true"></description>
</resource>
<resource>
<type>private_key</type>
<name>baz</name>
<provider>tls</provider>
<source>hashicorp/tls</source>
<mode>managed</mode>
<version>latest</version>
<description>this description for tls_private_key.baz which can be multiline.</description>
</resource>
<resource>
<type>caller_identity</type>
<name>current</name>
<provider>aws</provider>
<source>hashicorp/aws</source>
<mode>data</mode>
<version>latest</version>
<description xsi:nil="true"></description>
</resource>
<resource>
<type>caller_identity</type>
<name>ident</name>
<provider>aws</provider>
<source>hashicorp/aws</source>
<mode>data</mode>
<version>latest</version>
<description xsi:nil="true"></description>
</resource>
</resources>
</module>