Terradoc
Terradoc is a tool creating documentation from terraform code. It will parse all of the terraform code in a given directory and generate 5 data tables.
- Data Sources
- Modules
- Outputs
- Resources
- Variables
You can then use the custom tags to insert these data tables into your README or other markdown files.
Installation
Add this line to your application's Gemfile:
gem 'terradoc'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install terradoc
Usage
Usage: terradoc
-h, --help Display this screen
-v, --verbose Turn on verbose mode
-o, --output string Name of the output file. [default: README.md]
-p, --path string Path to the terraform code. [default: current directory]
Once you have installed Terradoc you can simply run terradoc
and it will generate the output.
Contributing to Terradoc
Setup
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will
create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Testing
For local testing make sure that you run bundle exec rspec spec
and then rake install
to install the gem locally.
For further information please refer to the contributing documentation.
To-Do List
- [ ] Allow for setting of root url for linking to terraform registry
- [ ] Allow different format outputs
- [ ] Allow got global config files
- [ ] Pre/Post git commit hook