for Terraform module

Any tips on how to generate the file with all its contents from requirements to usage? Thank you

terraform-docs (Introduction | terraform-docs) can generate useful information for you though I suspect not exactly what you’re after. It may be of interest though.

I’ve extended the idea by using terraform-docs yaml to generate a yaml file that summarises the configuration. I then run some python code that generates some human-readable output based on the contents of that yaml file. I use cog to generate the markdown.

Hope that helps.

Thank you @jamiekt for replying. I was able to generate the which typically has these contents:
Usage example
In my case, the Requirements, providers and Modules are empty. Do I write those blocks myself or they were supposed to be generated as well with Terraform-docs? Also how do I include a usage example?


Given I can’t see your configuration I can’t tell you why “modules” is empty. Does your configuration contain any modules?
“Providers” exists on the screenshot you provided so I’m confused why you say it is empty
I don’t know what you mean by “Requirements”.

Can you clarify what you’d expect to see in a usage example?