Documentation
¶
Overview ¶
Package configstack provides the implementation of the Runner, which run units as groups.
Index ¶
- func Build(ctx context.Context, l log.Logger, ...) (common.StackRunner, error)
- type DependencyController
- type DependencyOrder
- type Runner
- func (runner *Runner) GetStack() *common.Stack
- func (runner *Runner) GetUnitRunGraph(terraformCommand string) ([]common.Units, error)
- func (runner *Runner) JSONUnitDeployOrder(terraformCommand string) (string, error)
- func (runner *Runner) ListStackDependentUnits() map[string][]string
- func (runner *Runner) LogUnitDeployOrder(l log.Logger, terraformCommand string) error
- func (runner *Runner) ResolveTerraformModules(ctx context.Context, l log.Logger, terragruntConfigPaths []string) (common.Units, error)
- func (runner *Runner) Run(ctx context.Context, l log.Logger, opts *options.TerragruntOptions) error
- func (runner *Runner) RunUnits(ctx context.Context, opts *options.TerragruntOptions) error
- func (runner *Runner) RunUnitsIgnoreOrder(ctx context.Context, opts *options.TerragruntOptions) error
- func (runner *Runner) RunUnitsReverseOrder(ctx context.Context, opts *options.TerragruntOptions) error
- func (runner *Runner) SetParseOptions(parserOptions []hclparse.Option)
- func (runner *Runner) SetReport(report *report.Report)
- func (runner *Runner) SetTerragruntConfig(config *config.TerragruntConfig)
- func (runner *Runner) Units() common.Units
- func (runner *Runner) WithOptions(opts ...common.Option) *Runner
- type RunningUnits
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DependencyController ¶
type DependencyController struct {
Runner *common.UnitRunner
DependencyDone chan *DependencyController
Dependencies map[string]*DependencyController
NotifyWhenDone []*DependencyController
}
DependencyController manages dependencies and dependency order, and contains a UnitRunner.
func NewDependencyController ¶
func NewDependencyController(unit *common.Unit) *DependencyController
NewDependencyController Create a new dependency controller for the given unit.
type DependencyOrder ¶
type DependencyOrder int
DependencyOrder controls in what order dependencies should be enforced between units.
const ( NormalOrder DependencyOrder = iota ReverseOrder IgnoreOrder )
type Runner ¶
Runner implements the Stack interface and represents a stack of Terraform units (i.e. folders with Terraform templates) that you can "spin up" or "spin down" in a single command (formerly Stack)
func NewRunner ¶
func NewRunner(l log.Logger, terragruntOptions *options.TerragruntOptions, opts ...common.Option) *Runner
NewRunner creates a new Runner.
func (*Runner) GetUnitRunGraph ¶
GetUnitRunGraph converts the unit list to a graph that shows the order in which the units will be applied/destroyed. The return structure is a list of lists, where the nested list represents units that can be deployed concurrently, and the outer list indicates the order. This will only include those units that do NOT have the exclude flag set.
func (*Runner) JSONUnitDeployOrder ¶
JSONUnitDeployOrder will return the units that will be deployed by a plan/apply operation, in the order that the operations happen.
func (*Runner) ListStackDependentUnits ¶
ListStackDependentUnits - build a map with each unit and its dependent units
func (*Runner) LogUnitDeployOrder ¶
LogUnitDeployOrder will log the units 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 (*Runner) ResolveTerraformModules ¶
func (runner *Runner) ResolveTerraformModules(ctx context.Context, l log.Logger, terragruntConfigPaths []string) (common.Units, error)
ResolveTerraformModules goes through each of the given Terragrunt configuration files and resolve the unit that configuration file represents into a Unit struct. Return the list of these Unit structs.
func (*Runner) RunUnits ¶
RunUnits runs the given map of unit path to runningUnit. To "run" a unit, execute the runTerragrunt command in its TerragruntOptions object. The units will be executed in an order determined by their inter-dependencies, using as much concurrency as possible.
func (*Runner) RunUnitsIgnoreOrder ¶
func (runner *Runner) RunUnitsIgnoreOrder(ctx context.Context, opts *options.TerragruntOptions) error
RunUnitsIgnoreOrder runs the given map of unit path to runningUnit. To "run" a unit, execute the runTerragrunt command in its TerragruntOptions object. The units will be executed without caring for inter-dependencies.
func (*Runner) RunUnitsReverseOrder ¶
func (runner *Runner) RunUnitsReverseOrder(ctx context.Context, opts *options.TerragruntOptions) error
RunUnitsReverseOrder runs the given map of unit path to runningUnit. To "run" a unit, execute the runTerragrunt command in its TerragruntOptions object. The units will be executed in the reverse order of their inter-dependencies, using as much concurrency as possible.
func (*Runner) SetParseOptions ¶
SetParseOptions sets the report for the stack.
func (*Runner) SetTerragruntConfig ¶
func (runner *Runner) SetTerragruntConfig(config *config.TerragruntConfig)
SetTerragruntConfig sets the report for the stack.
type RunningUnits ¶
type RunningUnits map[string]*DependencyController
RunningUnits is a map of unit path to DependencyController, representing the units that are currently running or
func ToRunningUnits ¶
func ToRunningUnits(units common.Units, dependencyOrder DependencyOrder, r *report.Report, opts *options.TerragruntOptions) (RunningUnits, error)
ToRunningUnits converts the list of units to a map from unit path to a runningUnit struct. This struct contains information about executing the unit, such as whether it has finished running or not and any errors that happened. Note that this does NOT actually run the unit. For that, see the RunUnits method.
func (RunningUnits) RemoveFlagExcluded ¶
func (units RunningUnits) RemoveFlagExcluded(r *report.Report, reportExperiment bool) (RunningUnits, error)
RemoveFlagExcluded returns a cleaned-up map that only contains units and dependencies that should not be excluded