--- title: "xml" description: "Generate XML of inputs and outputs" menu: docs: parent: "terraform-docs" weight: 963 toc: true --- ## Synopsis Generate XML of inputs and outputs. ```console terraform-docs xml [PATH] [flags] ``` ## Options ```console -h, --help help for xml ``` ## Inherited Options ```console -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 "\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") --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`][examples] module: ```shell terraform-docs xml --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 |
bool-1 bool It's bool number one. true false bool-2 bool It's bool number two. false false bool-3 bool true false bool_default_false bool false false input-with-code-block list This is a complicated one. We need a newline. And an example in a code block ``` default = [ "machine rack01:neptune" ] ``` name rack:location false input-with-pipe string It includes v1 | v2 | v3 v1 false input_with_underscores any A variable with underscores. true list-1 list It's list number one. a b c false list-2 list It's list number two. true list-3 list false list_default_empty list(string) false long_type object({ name = string, foo = object({ foo = string, bar = string }), bar = object({ foo = string, bar = string }), fizz = list(string), buzz = list(string) }) This description is itself markdown. It spans over multiple lines. bar bar fizz buzz foo foo hello false map-1 map It's map number one. 1 2 3 false map-2 map It's map number two. true map-3 map false no-escape-default-value string The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. VALUE_WITH_UNDERSCORE false number-1 number It's number number one. 42 false number-2 number It's number number two. true number-3 number 19 false number-4 number 15.75 false number_default_zero number 0 false object_default_empty object({}) false string-1 string It's string number one. bar false string-2 string It's string number two. true string-3 string false string-special-chars string \.<>[]{}_- false string_default_empty string false string_default_null string false string_no_default string true unquoted any true with-url string The description contains url. https://www.domain.com/foo/bar_baz.html false bar baz 4.5.6 baz baz 4.5.6 foo bar 1.2.3 another type of description for module foo foobar git@github.com:module/path v7.8.9 output-0.12 terraform 0.12 only output-1 It's output number one. output-2 It's output number two. unquoted It's unquoted output. aws >= 2.15.0 aws ident >= 2.15.0 foo >= 1.0 null tls terraform >= 0.12 aws >= 2.15.0 foo >= 1.0 random >= 2.2.0 resource baz foo https://registry.acme.com/foo managed latest resource foo null hashicorp/null managed latest private_key baz tls hashicorp/tls managed latest this description for tls_private_key.baz which can be multiline. caller_identity current aws hashicorp/aws data latest caller_identity ident aws hashicorp/aws data latest
[examples]: https://github.com/terraform-docs/terraform-docs/tree/master/examples