Version: v0.6.7 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 20 Imported by: 0



Package generate has the logic to generate Graph from HCL or State



This section is empty.


This section is empty.


func FromHCL

func FromHCL(fs afero.Fs, path string, opt Options) (*graph.Graph, error)

FromHCL generates a new graph from the HCL on the path, it can be a file or a Module/Dir

func FromState

func FromState(tfstate json.RawMessage, opt Options) (*graph.Graph, map[string]interface{}, error)

FromState generate a graph.Graph from the tfstate applying the opt

func ValidateTFStateVersion added in v0.6.7

func ValidateTFStateVersion(b []byte) error

ValidateTFStateVersion validates that the version is the one we support which is only 3 and 4


type Options

type Options struct {
	// Raw means the RawProvider instead of the
	// specific one
	Raw bool

	// Clean means that the Nodes that do not have
	// any connection will be "removed"
	Clean bool

	// Connections toggles the Provider logic for
	// merging Edges between Nodes into one
	Connections bool

	// ExternalNodes will try to add extra
	// Nodes detected to make the graph better,
	// like the 'im_out'
	ExternalNodes bool

Options are the possible options that can be used to generate a Graph

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL