How to Use Terraform Visualizer with Inkdrop

Dec 18, 2023 | Programming

Inkdrop is a CLI tool that creates interactive diagrams to visualize your Terraform. It helps you onboard engineers, generate documentation, and understand dependencies faster.

Inkdrop

Overview

Inkdrop generates a visual, interactive map of your resources, helping you understand relationships and dependencies. Allowing you to quickly review infrastructure and onboard new engineers with ease.

Installation

To start using Inkdrop, you can install it using one of the following methods:

  • With Brew:
    brew tap inkdrop-org/inkdrop-visualizer
    brew install inkdrop-visualizer
  • With Linux:
    wget https://github.com/inkdrop-org/inkdrop-visualizer/releases/latest/download/inkdrop-linux-x64.tar.gz
    tar -xzf inkdrop-linux-x64.tar.gz
    chmod +x inkdrop
    mv inkdrop /usr/local/bin
  • With NPM:
    npm install -g inkdrop-visualizer
  • With Docker:

Usage

To use Inkdrop, run it where you would normally execute Terraform commands:

inkdrop
terraform init
terraform plan -out plan.out
inkdrop plan.out

This will launch an interactive WebUI, showing you which resources will change based on your tf.plan. By clicking on a resource, you can view additional details, including variables and outputs used, while also filtering by resource type and tags.

Command Line Arguments

Here are some command line arguments you can use with Inkdrop:

Argument Description Example Usage
(no argument) Automatically launches a browser tab to display the diagram interactively. inkdrop
plan-filename Visualizes changes from a specified terraform plan file. inkdrop plan.out
–state-dirs List of directories with Terraform configuration files to visualize multiple states. inkdrop plan.out –state-dirs . /pathtotfdir1 /pathtotfdir2
–help, -h Displays help information about the CLI tool. inkdrop –help
–version, -v Shows the current version number. inkdrop –version
–debug Shows logs for diagram generation. inkdrop –debug
–path Sets the working directory for a specified Terraform project path. inkdrop –path .repos/my-tf-project
–renderer-port Defines the port for the local diagram rendering service (default: 3000). inkdrop –renderer-port 8080

CI Usage

To use Inkdrop in your CI process, check out these integrations:

The runner will comment an SVG Image in the PR. Using the Inkdrop extension, this image becomes interactive and behaves like the CLI version when clicked.

Docker Usage

To run Inkdrop using Docker, use the following command:

docker run -v pathtoyourterraformroot:tfroot \
--env TF_VERSION=1.5.7 \
-p 3000:3000 \
-it inkdroporg/inkdrop:latest plan.out [additional arguments]

Replace pathtoyourterraformroot with your local Terraform root directory. Ensure that the TF_VERSION matches your local Terraform version.

Troubleshooting

If you encounter any issues during your experience with Inkdrop, a good starting point is to use the --debug flag and report any issues you find. Together we can resolve any concerns!

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox