Skip to content

Conversation

@metmajer
Copy link
Member

Default values are presented in JSON. The following example shows the processing of a Terraform variable of type map:

variable "foo" {
  default = {
    bar = 1
    baz = "two"
  }

  description = "Some variable named 'foo'."
  type = "map"
}
$ terraform-docs json .

[…]
{
  "Name": "foo",
  "Description": "Some variable named 'foo'.",
  "Default": {
    "Type": "map",
    "Value": {
      "bar": 1,
      "baz": "two"
    }
  },
  "Type": "map"
}
[…]
$ terraform-docs md .
Name Description Type Default Required
foo Some variable named 'foo'. map { "bar": 1, "baz": "two" } no
$ terraform-docs .

[…]
var.foo ({ "bar": 1, "baz": "two" })
Some variable named 'foo'.
[…]

@metmajer metmajer merged commit 15924e4 into master Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants