Documentation ¶
Index ¶
- Variables
- type DependencyCycleError
- type DependencyNotFoundWhileCrossLinkingError
- type DependencyOrder
- type ForceLogLevelHook
- type InfiniteRecursionError
- type LogEntriesDropperFormatter
- type ModuleStatus
- type Option
- type ProcessingModuleDependencyError
- type ProcessingModuleError
- type RunningModule
- type RunningModules
- type Stack
- func (stack *Stack) GetModuleRunGraph(terraformCommand string) ([]TerraformModules, error)
- func (stack *Stack) Graph(terragruntOptions *options.TerragruntOptions)
- func (stack *Stack) JsonModuleDeployOrder(terraformCommand string) (string, error)
- func (stack *Stack) ListStackDependentModules() map[string][]string
- func (stack *Stack) LogModuleDeployOrder(logger *logrus.Entry, terraformCommand string) error
- func (stack *Stack) ResolveTerraformModules(ctx context.Context, terragruntConfigPaths []string) (TerraformModules, error)
- func (stack *Stack) Run(ctx context.Context, terragruntOptions *options.TerragruntOptions) error
- func (stack *Stack) String() string
- func (stack *Stack) WithOptions(opts ...Option) *Stack
- type TerraformModule
- type TerraformModules
- func (modules TerraformModules) CheckForCycles() error
- func (modules TerraformModules) RunModules(ctx context.Context, opts *options.TerragruntOptions, parallelism int) error
- func (modules TerraformModules) RunModulesIgnoreOrder(ctx context.Context, opts *options.TerragruntOptions, parallelism int) error
- func (modules TerraformModules) RunModulesReverseOrder(ctx context.Context, opts *options.TerragruntOptions, parallelism int) error
- func (modules TerraformModules) ToRunningModules(dependencyOrder DependencyOrder) (RunningModules, error)
- func (modules TerraformModules) WriteDot(w io.Writer, terragruntOptions *options.TerragruntOptions) error
- type TerraformModulesMap
- type UnrecognizedDependencyError
Constants ¶
This section is empty.
Variables ¶
var NoTerraformModulesFound = errors.New("Could not find any subfolders with Terragrunt configuration files")
Functions ¶
This section is empty.
Types ¶
type DependencyCycleError ¶ added in v0.61.0
type DependencyCycleError []string
func (DependencyCycleError) Error ¶ added in v0.61.0
func (err DependencyCycleError) Error() string
type DependencyNotFoundWhileCrossLinkingError ¶ added in v0.61.0
type DependencyNotFoundWhileCrossLinkingError struct { Module *RunningModule Dependency *TerraformModule }
func (DependencyNotFoundWhileCrossLinkingError) Error ¶ added in v0.61.0
func (err DependencyNotFoundWhileCrossLinkingError) Error() string
type DependencyOrder ¶
type DependencyOrder int
This controls in what order dependencies should be enforced between modules
const ( NormalOrder DependencyOrder = iota ReverseOrder IgnoreOrder )
type ForceLogLevelHook ¶ added in v0.35.5
ForceLogLevelHook - log hook which can change log level for messages which contains specific substrings
func NewForceLogLevelHook ¶ added in v0.35.5
func NewForceLogLevelHook(forcedLevel logrus.Level) *ForceLogLevelHook
NewForceLogLevelHook - create default log reduction hook
func (*ForceLogLevelHook) Fire ¶ added in v0.35.5
func (hook *ForceLogLevelHook) Fire(entry *logrus.Entry) error
Fire - function invoked against log entries when entry will match loglevel from Levels()
func (*ForceLogLevelHook) Levels ¶ added in v0.35.5
func (hook *ForceLogLevelHook) Levels() []logrus.Level
Levels - return log levels on which hook will be triggered
type InfiniteRecursionError ¶ added in v0.61.0
type InfiniteRecursionError struct { RecursionLevel int Modules map[string]*TerraformModule }
func (InfiniteRecursionError) Error ¶ added in v0.61.0
func (err InfiniteRecursionError) Error() string
type LogEntriesDropperFormatter ¶ added in v0.35.5
LogEntriesDropperFormatter - custom formatter which will ignore log entries which has lower level than preconfigured in logger
type ModuleStatus ¶
type ModuleStatus int
Represents the status of a module that we are trying to apply as part of the apply-all or destroy-all command
const ( Waiting ModuleStatus = iota Running Finished )
type Option ¶ added in v0.61.0
func WithChildTerragruntConfig ¶ added in v0.61.0
func WithChildTerragruntConfig(config *config.TerragruntConfig) Option
func WithParseOptions ¶ added in v0.61.0
type ProcessingModuleDependencyError ¶ added in v0.61.0
type ProcessingModuleDependencyError struct { Module *TerraformModule Dependency *TerraformModule Err error }
func (ProcessingModuleDependencyError) Error ¶ added in v0.61.0
func (err ProcessingModuleDependencyError) Error() string
func (ProcessingModuleDependencyError) ExitStatus ¶ added in v0.61.0
func (err ProcessingModuleDependencyError) ExitStatus() (int, error)
func (ProcessingModuleDependencyError) Unwrap ¶ added in v0.61.0
func (err ProcessingModuleDependencyError) Unwrap() error
type ProcessingModuleError ¶ added in v0.61.0
type ProcessingModuleError struct { UnderlyingError error ModulePath string HowThisModuleWasFound string }
func (ProcessingModuleError) Error ¶ added in v0.61.0
func (err ProcessingModuleError) Error() string
func (ProcessingModuleError) Unwrap ¶ added in v0.61.0
func (err ProcessingModuleError) Unwrap() error
type RunningModule ¶ added in v0.66.7
type RunningModule struct { Module *TerraformModule Status ModuleStatus Err error DependencyDone chan *RunningModule Dependencies map[string]*RunningModule NotifyWhenDone []*RunningModule FlagExcluded bool }
Represents a module we are trying to "run" (i.e. apply or destroy) as part of the apply-all or destroy-all command
type RunningModules ¶ added in v0.66.7
type RunningModules map[string]*RunningModule
func (RunningModules) RemoveFlagExcluded ¶ added in v0.66.7
func (modules RunningModules) RemoveFlagExcluded() map[string]*RunningModule
Return a cleaned-up map that only contains modules and dependencies that should not be excluded
type Stack ¶
type Stack struct { Modules TerraformModules // contains filtered or unexported fields }
Represents a stack of Terraform modules (i.e. folders with Terraform templates) that you can "spin up" or "spin down" in a single command
func FindStackInSubfolders ¶
func FindStackInSubfolders(ctx context.Context, terragruntOptions *options.TerragruntOptions, opts ...Option) (*Stack, error)
Find all the Terraform modules in the subfolders of the working directory of the given TerragruntOptions and assemble them into a Stack object that can be applied or destroyed in a single command
func NewStack ¶ added in v0.61.0
func NewStack(terragruntOptions *options.TerragruntOptions, opts ...Option) *Stack
func (*Stack) GetModuleRunGraph ¶ added in v0.66.7
func (stack *Stack) GetModuleRunGraph(terraformCommand string) ([]TerraformModules, error)
GetModuleRunGraph converts the module list to a graph that shows the order in which the modules will be applied/destroyed. The return structure is a list of lists, where the nested list represents modules that can be deployed concurrently, and the outer list indicates the order. This will only include those modules that do NOT have the exclude flag set.
func (*Stack) Graph ¶ added in v0.23.7
func (stack *Stack) Graph(terragruntOptions *options.TerragruntOptions)
Graph creates a graphviz representation of the modules
func (*Stack) JsonModuleDeployOrder ¶ added in v0.48.5
JsonModuleDeployOrder will return the modules that will be deployed by a plan/apply operation, in the order that the operations happen.
func (*Stack) ListStackDependentModules ¶ added in v0.61.0
ListStackDependentModules - build a map with each module and its dependent modules
func (*Stack) LogModuleDeployOrder ¶ added in v0.35.4
LogModuleDeployOrder will log the modules that will be deployed by this operation, in the order that the operations happen. For plan and apply, the order will be bottom to top (dependencies first), while for destroy the order will be in reverse.
func (*Stack) ResolveTerraformModules ¶ added in v0.61.0
func (stack *Stack) ResolveTerraformModules(ctx context.Context, terragruntConfigPaths []string) (TerraformModules, error)
Go through each of the given Terragrunt configuration files and resolve the module that configuration file represents into a TerraformModule struct. Return the list of these TerraformModule structs.
func (*Stack) WithOptions ¶ added in v0.61.0
type TerraformModule ¶
type TerraformModule struct { Path string RelativePath string Dependencies TerraformModules Config config.TerragruntConfig TerragruntOptions *options.TerragruntOptions AssumeAlreadyApplied bool FlagExcluded bool }
Represents a single module (i.e. folder with Terraform templates), including the Terragrunt configuration for that module and the list of other modules that this module depends on
func (*TerraformModule) MarshalJSON ¶ added in v0.48.5
func (module *TerraformModule) MarshalJSON() ([]byte, error)
func (*TerraformModule) String ¶
func (module *TerraformModule) String() string
Render this module as a human-readable string
type TerraformModules ¶ added in v0.61.0
type TerraformModules []*TerraformModule
func FindWhereWorkingDirIsIncluded ¶ added in v0.33.0
func FindWhereWorkingDirIsIncluded(ctx context.Context, terragruntOptions *options.TerragruntOptions, terragruntConfig *config.TerragruntConfig) TerraformModules
FindWhereWorkingDirIsIncluded - find where working directory is included, flow: 1. Find root git top level directory and build list of modules 2. Iterate over includes from terragruntOptions if git top level directory detection failed 3. Filter found module only items which has in dependencies working directory
func (TerraformModules) CheckForCycles ¶ added in v0.61.0
func (modules TerraformModules) CheckForCycles() error
Check for dependency cycles in the given list of modules and return an error if one is found
func (TerraformModules) RunModules ¶ added in v0.61.0
func (modules TerraformModules) RunModules(ctx context.Context, opts *options.TerragruntOptions, parallelism int) error
Run the given map of module path to runningModule. To "run" a module, execute the RunTerragrunt command in its TerragruntOptions object. The modules will be executed in an order determined by their inter-dependencies, using as much concurrency as possible.
func (TerraformModules) RunModulesIgnoreOrder ¶ added in v0.61.0
func (modules TerraformModules) RunModulesIgnoreOrder(ctx context.Context, opts *options.TerragruntOptions, parallelism int) error
Run the given map of module path to runningModule. To "run" a module, execute the RunTerragrunt command in its TerragruntOptions object. The modules will be executed without caring for inter-dependencies.
func (TerraformModules) RunModulesReverseOrder ¶ added in v0.61.0
func (modules TerraformModules) RunModulesReverseOrder(ctx context.Context, opts *options.TerragruntOptions, parallelism int) error
Run the given map of module path to runningModule. To "run" a module, execute the RunTerragrunt command in its TerragruntOptions object. The modules will be executed in the reverse order of their inter-dependencies, using as much concurrency as possible.
func (TerraformModules) ToRunningModules ¶ added in v0.66.7
func (modules TerraformModules) ToRunningModules(dependencyOrder DependencyOrder) (RunningModules, error)
Convert the list of modules to a map from module path to a runningModule struct. This struct contains information about executing the module, such as whether it has finished running or not and any errors that happened. Note that this does NOT actually run the module. For that, see the RunModules method.
func (TerraformModules) WriteDot ¶ added in v0.61.0
func (modules TerraformModules) WriteDot(w io.Writer, terragruntOptions *options.TerragruntOptions) error
WriteDot is used to emit a GraphViz compatible definition for a directed graph. It can be used to dump a .dot file. This is a similar implementation to terraform's digraph https://github.com/hashicorp/terraform/blob/master/digraph/graphviz.go adding some styling to modules that are excluded from the execution in *-all commands
type TerraformModulesMap ¶ added in v0.61.0
type TerraformModulesMap map[string]*TerraformModule
type UnrecognizedDependencyError ¶ added in v0.61.0
type UnrecognizedDependencyError struct { ModulePath string DependencyPath string TerragruntConfigPaths []string }
func (UnrecognizedDependencyError) Error ¶ added in v0.61.0
func (err UnrecognizedDependencyError) Error() string