Transform tab

Transform tab is used to transform Terraform code into diagrams that can be presented on interactive Canvas. Operation can also be reversed.

Transform HCL to JSON

  1. Select all Terraform files that you want to transform into graph

  2. As an output, you need to select or create two new files.

  3. Click on convert.

Select all Terraform files to convert. Type new or use existing file to store Graphviz JSON data.
Type new or use existing file to store HCL JSON data. They store Terraform data about resources in JSON format.
Newly created JSON files that can be used to load into Canvas.

Transform JSON to HCL

Transform HCL JSON into Terraform code and style it with "terraform fmt" command.

  1. Select JSON file to convert.

  2. Select existing or create new file as an output for Terraform code.

Select JSON file to convert into Terraform code. Create new or select existing file as an output.
Verify transformation output in Execution logs. Reload workspace to check newly created files.
Example output of Terraform to JSON convertion. When Canvas changes are saved, they will be reflected in HCL JSON.
Example output of JSON to Terraform conversion.

Load JSON to canvas.

Load Graphviz and HCL data into interactive diagram. To verify data display, switch view from Text to Canvas.

  1. Convert Terraform files into HCL and Graphviz JSON data.

  2. Select HCL JSON and Graphviz data to be loaded into Canvas.

  3. Switch view from Text to Canvas

  4. If you plan to change data on Canvas, you need to Save it back to JSON file.

Select files to be loaded into canvas.
Change mode to Canvas.

Save canvas data to JSON

If you plan to change data on diagram and transform it to Terraform code, follow steps below:

  1. Make changes on diagram.

  2. Click on "Save Canvas JSON to file"

  3. Select existing or type new file name.

  4. Verify that file was updated with new data.

Last updated