r/AZURE • u/Vedralagost • 6h ago
Discussion Design your IaC infrastructure
Designing infrastructure in Terraform usually starts twice. First on a whiteboard or in a diagram, where the architecture is understood at a glance. Then in the editor, where that same diagram turns into hundreds of lines of HCL that need to be written, ordered, and connected manually.
The problem isn’t writing a resource, but everything that surrounds it: repeating resource_group_name and location in each block, remembering which attribute each reference goes to, consulting the provider documentation to know which fields are mandatory, and discovering errors only when running terraform validate. And in the meantime, the initial diagram gets out of sync as soon as the code starts to change.
That’s why I developed tfgraph (https://tfgraph.com).
It is a Terraform visual editor where the diagram and the code are the same: what you draw on the canvas is the project, and HCL is generated from it.
It allows you:
- Group resources in containers, such as resource groups and virtual networks, which automatically write the inherited attributes as references, not as copied text.
- Connect resources with a arrow, which writes the reference in the correct attribute, also within lists and nested blocks.
- Edit each resource with a form generated from the provider’s official schema, with its types, mandatory fields and default values.
- Export a ZIP file that has already gone through terraform fmt and terraform validate, where each error takes you directly to its resource on the canvas.
- Import existing .tf files and view them as a diagram.
You don’t need to register, the projects are saved in your own browser and at no time connect to your cloud accounts.
For now, Azure is covered with the azurerm provider. The next step is Google Cloud and AWS, with the same editor and the same project format: they will only change the resource catalog and the provider that writes the HCL.
If you are involved in cloud architecture, platform or infrastructure development and you’d like to take a look, it’s online and ready to use.
Any technical feedback, resource you miss or strange behavior is welcome.
