tg

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package tg implements functions to deal with Terragrunt files.

Index

Constants

View Source
const ErrParsing errors.Kind = "parsing Terragrunt file"

ErrParsing indicates there is an error parsing a Terragrunt file.

Variables

This section is empty.

Functions

func NewTerragruntLogger added in v0.15.0

func NewTerragruntLogger(logger zerolog.Logger) (log.Logger, func() error)

NewTerragruntLogger creates a Terragrunt-compatible logger from a zerolog logger. Returns the logger and a cleanup function that must be called to prevent resource leaks.

Types

type Module

type Module struct {
	Path       project.Path  `json:"path"`
	Source     string        `json:"source"`
	ConfigFile project.Path  `json:"config"`
	After      project.Paths `json:"after"`

	// DependsOn are paths that, when changed, must mark the module as changed.
	DependsOn project.Paths `json:"depends_on,omitempty"`

	// DependencyBlocks are paths from Terragrunt dependency blocks (data dependencies).
	// These represent actual data dependencies and should widen scope for dependency flags.
	DependencyBlocks project.Paths `json:"dependency_blocks,omitempty"`

	FilesProcessed map[string]struct{}
}

Module is a Terragrunt module.

func LoadModule added in v0.13.1

func LoadModule(rootdir string, dir project.Path, fname string, trackDependencies bool) (mod *Module, isRootModule bool, err error)

LoadModule loads a Terragrunt module from dir and fname.

If fname is not absolute, it is considered to be relative to dir.

type Modules

type Modules []*Module

Modules is a list of Module.

func ScanModules

func ScanModules(rootdir string, dir project.Path, trackDependencies bool) (Modules, error)

ScanModules scans dir looking for Terragrunt modules. It returns a list of modules with its "DependsOn paths" computed.

Jump to

Keyboard shortcuts

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