tfdoc 0.1.5

Generate Terraform module documentation
Documentation
  • Coverage
  • 0%
    0 out of 19 items documented0 out of 6 items with examples
  • Size
  • Source code size: 78.35 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.77 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • maur1th/tfdoc
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • maur1th

tfdoc

This project aims at generating Terraform module documentation.

Usage

tfdoc will parse all the files within a module's directory and generate a README.tf accordingly:

# Title: The name of the module
# Top comment prefixed by "Title: " and the following lines
# will be at the top of the Markdown file

variable "environment" {
  description = "Variable descriptions will be parsed"
}

# tfdoc keeps comments right on top of resource, variable
# and output blocks. All variables and outputs are kept.
# Only resources with comments on top are.
resource "aws_instance" "this" {
  # stuff
}

resource "aws_instance" "no_comment_here" {
  # stuff
}

##
## tfdoc discards other "orphaned" comments
##

# We can have both comments on top
output "name" {
  description = "and within outputs and variables"
}

# Data blocks are ignored
data "aws_ami" "node" {}
$ tfdoc $PATH_TO_MODULE
# The name of the module

Top comment prefixed by "Title: " and the following lines will be at the top of the Markdown file

## Resources

* `aws_instance.this`: tfdoc keeps comments right on top of resource, variable and output blocks. All variables and outputs are kept. Only resources with comments on top are.

## Inputs

* `environment`: Variable descriptions will be parsed

## Outputs

* `name`: We can have both comments on top and within outputs and variables

Original idea by https://github.com/jyrivallan