Visual representation of a Terraform plan, showing added, deleted and updated resources.
Installing
This extension is available for free in the Visual Studio Code Marketplace
You can generate a Terraform graph in three steps:
- If you haven't done so already, install Terraform
- Open command palette using Ctrl+Shift+P
- Select command
Generate Terraform Graph
This will open a terminal in your current working directory and run the following command:
terraform plan -out=plan && terraform show -json plan > plan.tfgraph
You can customize the command using the terraform-graph.command
configuration option, e.g. in .vscode/settings.json
:
{
"terraform-graph.command": "terraform plan -out=plan && terraform show -json plan > plan.tfgraph"
}
If a file is currently open in your editor, the command will be run in the directory of the file.
The command generates two files:
- a Terraform plan file, which can be later applied using
terraform apply
command
- a
.tfgraph
file (which is actually a simple json file)
You can visualize your terraform graph by simply opening the .tfgraph
file in your editor.

On the left you can see all the resource changes. Red are the deleted resources, green the added ones and orange the updated ones.
When clicking on a resource, you can see on the left the properties that changed, with the same color mapping.
Issues and improvement
For any issues or improvement, you can open an issue on the github repository.
Any PR is welcome!