github.com/chalford/terraform@v0.3.7-0.20150113080010-a78c69a8c81f/website/source/docs/commands/graph.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "Command: graph" 4 sidebar_current: "docs-commands-graph" 5 description: |- 6 The `terraform graph` command is used to generate a visual representation of either a configuration or execution plan. The output is in the DOT format, which can be used by GraphViz to generate charts. 7 --- 8 9 # Command: graph 10 11 The `terraform graph` command is used to generate a visual 12 representation of either a configuration or execution plan. 13 The output is in the DOT format, which can be used by 14 [GraphViz](http://www.graphviz.org) to generate charts. 15 16 17 ## Usage 18 19 Usage: `terraform graph [options] PATH` 20 21 Outputs the visual graph of Terraform resources. If the path given is 22 the path to a configuration, the dependency graph of the resources are 23 shown. If the path is a plan file, then the dependency graph of the 24 plan itself is shown. 25 26 Options: 27 28 * `-module-depth=n` - The maximum depth to expand modules. By default this is 29 zero, which will not expand modules at all. 30 31 ## Generating Images 32 33 The output of `terraform graph` is in the DOT format, which can 34 easily be converted to an image by making use of `dot` provided 35 by GraphViz: 36 37 ``` 38 $ terraform graph | dot -Tpng > graph.png 39 ``` 40 41 Alternatively, the web-based [GraphViz Workspace](http://graphviz-dev.appspot.com) 42 can be used to quickly render DOT file inputs as well. 43 44 Here is an example graph output: 45  46