Add The possibility to export TF Documentation #177
-
Hello, I am trying to automaticaly document my terraform code and I use inframap to generate the diagram that is include in my readme.md file of my repo at precomit stage. That's a nice point but it could be a good Idea to have the ability to also generate some other output such as json data related to the object present in the diagram. That way you will have the ability to build accurate documentation on what is deployed. sampleDiagramazurerm_virtual_vwan.wan
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'll transfer this to an issue. I'll add a new option to choose the destination of a generated JSON file which will have the information found on the State/HCL. Internally on the The current format is something like {
"resources": {
"azurerm_virtual_wan": {
"vwan": {
"name": "value-name"
}
}
}
} but I think that for the actual file, as it has to be a representation of the Nodes, we'll go for something along the lines of {
"azurerm_virtual_wan.vwan": {
"name": "value-name"
}
} As it's easy/faster to parse and understand, each of the first level keys will be a node on the graph. The only thing that for now we'll not have is the |
Beta Was this translation helpful? Give feedback.
I'll transfer this to an issue.
I'll add a new option to choose the destination of a generated JSON file which will have the information found on the State/HCL.
Internally on the
generate.FromState
we already return a config, I'll validate the format to see if it's adequate and expose it to be written into a file. HCL does not have it yet but it should be easy to also make it return as it's kept internally but never returned.The current format is something like
but I think that for the actual file, as it has to be a representation of the Nodes, we'll go for something along the…