Skip to content

Instantly share code, notes, and snippets.

@nitrocode
Last active March 2, 2021 13:28
Show Gist options
  • Select an option

  • Save nitrocode/4de07fd583ac864b1d871634c890cc8d to your computer and use it in GitHub Desktop.

Select an option

Save nitrocode/4de07fd583ac864b1d871634c890cc8d to your computer and use it in GitHub Desktop.
Test markdown anchor for terraform-docs

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

  • list item 3
  • list item 4
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

Name Version
terraform >= 0.12
aws >= 2.15.0
random >= 2.2.0

Providers

Name Version
tls n/a
aws >= 2.15.0
aws.ident >= 2.15.0
null n/a

Modules

Name Source Version
foo bar 1.2.3
bar baz 4.5.6
baz baz 4.5.6

Resources

Name
aws_caller_identity
null_resource
tls_private_key

Inputs

Name Description Type Default Required
unquoted n/a any n/a yes
bool-3 n/a bool true no
bool-2 It's bool number two. bool false no
bool-1 It's bool number one. bool true no
string-3 n/a string "" no
string-2 It's string number two. string n/a yes
string-1 It's string number one. string "bar" no
string-special-chars n/a string "\\.<>[]{}_-" no
number-3 n/a number "19" no
number-4 n/a number 15.75 no
number-2 It's number number two. number n/a yes
number-1 It's number number one. number 42 no
map-3 n/a map {} no
map-2 It's map number two. map n/a yes
map-1 It's map number one. map
{
"a": 1,
"b": 2,
"c": 3
}
no
list-3 n/a list [] no
list-2 It's list number two. list n/a yes
list-1 It's list number one. list
[
"a",
"b",
"c"
]
no
input_with_underscores A variable with underscores. any n/a yes
input-with-pipe It includes v1 | v2 | v3 string "v1" no
input-with-code-block This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
list
[
"name rack:location"
]
no
long_type This description is itself markdown.

It spans over multiple lines.
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
no
no-escape-default-value The description contains something_with_underscore. Defaults to 'VALUE_WITH_UNDERSCORE'. string "VALUE_WITH_UNDERSCORE" no
with-url The description contains url. https://www.domain.com/foo/bar_baz.html string "" no
string_default_empty n/a string "" no
string_default_null n/a string null no
string_no_default n/a string n/a yes
number_default_zero n/a number 0 no
bool_default_false n/a bool false no
list_default_empty n/a list(string) [] no
object_default_empty n/a object({}) {} no

Outputs

Name Description
unquoted It's unquoted output.
output-2 It's output number two.
output-1 It's output number one.
output-0.12 terraform 0.12 only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment