Convert

Convert Terraform into an architecture diagram.

Terraform records dependencies explicitly through references, so the edges are read rather than inferred. It is one of the most reliable sources there is.

Download for macOS
v0.1.33 · .dmg · Apple Silicon & Intel
Signed & notarized by Apple · opens without a Gatekeeper warning
sha256 698955a0187bc039f4c74f5d05a9f10fbb27376a45788a0a241d1326b73873c7
Download for Windows instead
$curl -fsSL https://lucidtrain.com/install.sh | sh

Why Terraform converts well

When one resource interpolates another's attribute, that is a dependency the language itself has recorded. Most sources require inferring relationships; here they are declared. The result is a diagram whose edges are as accurate as the configuration, which is a much stronger guarantee than anything derived from reading application code.

Configuration or state

Reading .tf files gives you what should exist. Pointing it at a state file or a saved plan gives you what does. Those differ more often than anyone likes, usually because something was changed by hand, and knowing which question you are asking is worth being deliberate about.

Modules are followed

A diagram of a root module that shows module blocks as opaque boxes is not much use. Module sources are followed so the components inside them appear, which is what makes the output a diagram of the infrastructure rather than of the file layout.

Fidelity

Comes throughDoes not
ResourcesEvery declared resourceAnything created outside Terraform
DependenciesReferences and depends_onRuntime coupling not expressed in config
ModulesFollowed to source and expandedRemote modules not fetched locally
count and for_eachOne logical componentNot expanded per instance
VariablesResolved where defaults existValues supplied at apply time
ProvidersMapped to the external tierProvider-side behaviour

The command

shell
$ cd infra
$ lucid
# then: Diagram the infrastructure this Terraform describes
FAQ

Questions

Does it run terraform plan?

No. It reads files, and will use a plan or state file if you point it at one. Nothing executes and no credentials are needed.

Does it work with Pulumi or CloudFormation?

Yes. Terraform has its own page because HCL's reference structure makes the edges unusually reliable, not because the others are unsupported.

Can it show cost?

No. Infracost and your provider's calculator are the right tools for that.

Related