generate

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromHCL

func FromHCL(fs afero.Fs, path string, opt Options) (*graph.Graph, map[string]interface{}, 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

Types

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