GithubHelp home page GithubHelp logo

pcasteran / terraform-graph-beautifier Goto Github PK

View Code? Open in Web Editor NEW
337.0 337.0 12.0 595 KB

Terraform graph beautifier

License: Apache License 2.0

Makefile 10.53% Go 72.56% Dockerfile 8.77% Shell 8.14%
cytoscapejs golang graphviz graphviz-dot terraform terraform-graph

terraform-graph-beautifier's People

Contributors

dependabot[bot] avatar pcasteran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

terraform-graph-beautifier's Issues

Feature Request: Export as SVG/PNG

If the graph beautifier had the ability to export directly to svg/png format files,
these could be embedded into our terrform repos readme.md

Prebuilt binaries for darwin don't work

Hi, I downloaded prebuilt binaries for darwin from GitHub Releases but they don't work on my laptops.

Prebuilt binaries

My laptops

  • macOS 13.6 Apple M1
  • macOS Ventura 13.5.2 Intel Core i5

macOS 13.6 Apple M1

I tried both prebuilt binaries for darwin/amd64 and darwin/arm64.

darwin/arm64

$ ./terraform-graph-beautifier_0.3.3_darwin_arm64.tar.gz/terraform-graph-beautifier --help
zsh: killed      --help

darwin/amd64

$ ./terraform-graph-beautifier_0.3.3_darwin_amd64.tar.gz/terraform-graph-beautifier --help
zsh: segmentation fault   --help

macOS Ventura 13.5.2 Intel Core i5

darwin/amd64

./terraform-graph-beautifier_0.3.3_darwin_amd64.tar.gz/terraform-graph-beautifier --help
zsh: segmentation fault   --help

Prebuilt binary for linux/arm64 works well

On the other hand, the prebuilt binary for linux/arm64 works well on linux/arm64 (lima).

$ ./terraform-graph-beautifier_0.3.3_linux_arm64.tar.gz/terraform-graph-beautifier --help
Usage of /home/shunsukesuzuki.linux/.local/share/aquaproj-aqua/pkgs/github_release/github.com/pcasteran/terraform-graph-beautifier/v0.3.3/terraform-graph-beautifier_0.3.3_linux_arm64.tar.gz/terraform-graph-beautifier:
  -cyto-html-template string
    	Path of the HTML template to use for Cytoscape.js rendering (output-type="cyto-html"), if not set a default one is used
  -debug
    	Print debugging information to stderr
  -embed-modules
    	Embed a module subgraph inside its parent if true; otherwise the two modules are drawn at the same level and an edge is drawn from the parent to the child (default true)
  -exclude value
    	Pattern (regexp) of the resource to filter out (can be repeated multiple times)
  -graph-name string
    	Name of the output graph, defaults to working directory name (default "aqua-registry")
  -input string
    	Path of the input Graphviz file to read, if not set 'stdin' is used
  -keep-tf-junk
    	Do not remove the "junk" nodes and edges generated by 'terraform graph' (default false)
  -output string
    	Path of the output file to write, if not set 'stdout' is used
  -output-type string
    	Type of output, can be one the following : cyto-json, cyto-html, graphviz (default "cyto-html")
  -v	Print command version and exit

So this is the issue of prebuilt binaries for darwin.

Build a binary on my laptop works well

I tried to build terraform-graph-beautifier from source code by go install, then it works well.

$ go install github.com/pcasteran/terraform-graph-beautifier@latest
go: downloading github.com/pcasteran/terraform-graph-beautifier v0.3.3
go: downloading github.com/awalterschulze/gographviz v2.0.3+incompatible

$ ~/go/bin/terraform-graph-beautifier --help
Usage of /Users/shunsukesuzuki/go/bin/terraform-graph-beautifier:
  -cyto-html-template string
    	Path of the HTML template to use for Cytoscape.js rendering (output-type="cyto-html"), if not set a default one is used
  -debug
    	Print debugging information to stderr
  -embed-modules
    	Embed a module subgraph inside its parent if true; otherwise the two modules are drawn at the same level and an edge is drawn from the parent to the child (default true)
  -exclude value
    	Pattern (regexp) of the resource to filter out (can be repeated multiple times)
  -graph-name string
    	Name of the output graph, defaults to working directory name (default "aqua-registry")
  -input string
    	Path of the input Graphviz file to read, if not set 'stdin' is used
  -keep-tf-junk
    	Do not remove the "junk" nodes and edges generated by 'terraform graph' (default false)
  -output string
    	Path of the output file to write, if not set 'stdout' is used
  -output-type string
    	Type of output, can be one the following : cyto-json, cyto-html, graphviz (default "cyto-html")
  -v	Print command version and exit

Support Terraform 0.13

Using terraform-graph-beautifier with Terraform 0.13:

  • renders unexpected nodes (module.module_name (expand) and module.module_name (close))
  • adds (expand) label on every node.

Using 0.12:
terraform graph | terraform-graph-beautifier --exclude="module.root.provider" --output-type=cyto-html > tf-0.12.html
tf-0 12

Using 0.13:
terraform graph | terraform-graph-beautifier --exclude="module.root.provider" --output-type=cyto-html > tf-0.13.html
tf-0 13

Ability to see only the connected component of a given resource?

Hi and thanks for a great tool!

It's great for understanding existing Terraform code. I'm aware of the -exclude option but it doesn't quite cut it. What would be great to have is an option to specify a resource name, and based on that, the tool would filter out everything else that doesn't either depend on it or is depended on the given resource thereby presenting just a "slice" of the graph. This is to aid working with big graphs, especially that it doesn't seem to be possible to CTRL-F on the generated .html file (I guess that's due to how Cytoscape.js works).

This would require implementing some simple graph traversals but would reduce the graph to "just the interesting parts" when debugging some Terraform issue.

Curious to hear your thoughts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.