hclhelpers

package
v0.20.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlocksToMap added in v0.20.0

func BlocksToMap(blocks hcl.Blocks) map[string]*hcl.Block

BlocksToMap convert an array of blocks to a map keyed by block laabel NOTE: this panics if any blocks do not have a label

func FindChildBlocks added in v0.20.0

func FindChildBlocks(parentBlock *hcl.Block, blockType string) hcl.Blocks

func FindFirstChildBlock added in v0.20.0

func FindFirstChildBlock(parentBlock *hcl.Block, blockType string) *hcl.Block

func GetFirstBlockOfType added in v0.20.0

func GetFirstBlockOfType(blocks hcl.Blocks, blockType string) *hcl.Block

func ResourceNameFromTraversal

func ResourceNameFromTraversal(resourceType string, traversal hcl.Traversal) (string, bool)

ResourceNameFromTraversal converts a traversal to the name of the referenced resource We must take into account possible mod-name as first traversal element

func TraversalAsString

func TraversalAsString(traversal hcl.Traversal) string

TraversalAsString converts a traversal to a path string (if an absolute traversal is passed - convert to relative)

func TraversalsEqual

func TraversalsEqual(t1, t2 hcl.Traversal) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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