Skip to main content

Graph Command

Generate a diagram as PDF in a headless way directly from your terminal. pluralith graph creates a Terraform execution plan, draws a diagram and exports it as a PDF in a headless way.

pluralith graph [flags]

Example

Here's a quick example on how to generate a diagram in any given terraform directory. Copy it to your terminal, hit enter and see the magic happen! You should get a new file in your directory called FirstDiagram.pdf.

pluralith graph --title "Mark I" --author "Tony Stark" --version "0.0.1" --show-changes

Available Flags

FlagDescriptionType
--show-changesDetermines whether the exported diagram highlights changes made in the latest Terraform plan

bool

--show-driftDetermines whether the exported diagram highlights resource drift detected by Terraform

bool

--show-costsDetermines whether the exported diagram includes cost information (requires Infracost)

bool

--cost-modeDetermines which costs are shown. Can be delta or total (default delta)

string

--cost-periodDetermines over which period costs are aggregated. Can be hour or month (default month)

string

--cost-usage-filePath to an infracost usage file to be used for the cost breakdown

string

--file-nameThe name of the exported PDF

string

--out-dirThe directory the diagram should be exported to

string

--titleThe title of your diagram, will be displayed in the PDF output

string

--versionThe architecture version, will be displayed in the PDF output

string

--authorThe author of the diagram, will be displayed in the PDF output

string

--varA variable to pass to Terraform. Can be specified multiple times. (Format: --var='NAME=VALUE')

string

--var-filePath to a variable file to pass to Terraform. Can be specified multiple times.

string

--plan-filePath to an existing execution plan. (Generated with terraform plan -out plan.bin)

string

--plan-file-jsonPath to an existing JSON plan state. (Generated with terraform plan -out plan.bin and terraform show -json plan.bin > plan.json)

string