Documentation
¶
Index ¶
- Constants
- Variables
- type ModuleHandler
- type ModuleStatus
- type SimpleTerraformModule
- type SimpleTerraformModules
- type Stack
- func (stack Stack) JSON() string
- func (stack *Stack) Output(command string, terragruntOptions *options.TerragruntOptions) error
- func (stack *Stack) Plan(command string, terragruntOptions *options.TerragruntOptions) error
- func (stack *Stack) RunAll(command []string, terragruntOptions *options.TerragruntOptions, ...) error
- func (stack Stack) SimpleModules() SimpleTerraformModules
- func (stack *Stack) SortModules()
- func (stack *Stack) String() string
- type TerraformModule
- type UnrecognizedDependency
Constants ¶
const ( // NormalOrder describes the normal path for module execution. NormalOrder dependencyOrder = iota // ReverseOrder is used to execute modules in reverse order. ReverseOrder )
Variables ¶
var CreateMultiErrors = func(errs []error) error {
return errMulti{Errors: errs}
}
CreateMultiErrors declared as a variable instead of a function allows us to override the function used to compose multi error object. It is used if a command wants to change the default behavior of the severity analysis that is implemented by default.
Functions ¶
This section is empty.
Types ¶
type ModuleHandler ¶
type ModuleHandler func(TerraformModule, string, error) (string, error)
ModuleHandler is a function prototype to inject interaction during the processing. The function receive the current module, its output and its error in parameter. Normally, the handler should return the same error as received in parameter, but it is possible to alter the normal course of the proccess by changing the error result.
type ModuleStatus ¶
type ModuleStatus int
ModuleStatus represents the status of a module that we are trying to apply as part of the apply-all or destroy-all command
type SimpleTerraformModule ¶
type SimpleTerraformModule struct { Path string `json:"path"` Dependencies []string `json:"dependencies,omitempty" yaml:",omitempty"` }
SimpleTerraformModule represents a simplified version of TerraformModule
type SimpleTerraformModules ¶
type SimpleTerraformModules []SimpleTerraformModule
SimpleTerraformModules represents a list of simplified version of TerraformModule
func (SimpleTerraformModules) MakeRelative ¶
func (modules SimpleTerraformModules) MakeRelative() (result SimpleTerraformModules)
MakeRelative transforms each absolute path in relative path
type Stack ¶
type Stack struct { Path string Modules []*TerraformModule }
Stack 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(terragruntOptions *options.TerragruntOptions) (*Stack, error)
FindStackInSubfolders finds 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 (*Stack) Output ¶
func (stack *Stack) Output(command string, terragruntOptions *options.TerragruntOptions) error
Output prints the outputs of all the modules in the given stack in their specified order.
func (*Stack) Plan ¶
func (stack *Stack) Plan(command string, terragruntOptions *options.TerragruntOptions) error
Plan all the modules in the given stack in their specified order.
func (*Stack) RunAll ¶
func (stack *Stack) RunAll(command []string, terragruntOptions *options.TerragruntOptions, order dependencyOrder) error
RunAll runs the specified command on all modules in the given stack in their specified order.
func (Stack) SimpleModules ¶
func (stack Stack) SimpleModules() SimpleTerraformModules
SimpleModules returns the list of modules (simplified serializable version)
func (*Stack) SortModules ¶
func (stack *Stack) SortModules()
SortModules sorts in-place the list of modules topologically
type TerraformModule ¶
type TerraformModule struct { Path string Dependencies []*TerraformModule Config config.TerragruntConfig TerragruntOptions *options.TerragruntOptions AssumeAlreadyApplied bool }
TerraformModule 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 ResolveTerraformModules ¶
func ResolveTerraformModules(terragruntConfigPaths []string, terragruntOptions *options.TerragruntOptions) ([]*TerraformModule, error)
ResolveTerraformModules goes 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 structures.
func (*TerraformModule) Simple ¶
func (module *TerraformModule) Simple() SimpleTerraformModule
Simple returns a simplified version of the module with paths relative to working dir
func (TerraformModule) String ¶
func (module TerraformModule) String() string
Render this module as a human-readable string
type UnrecognizedDependency ¶
type UnrecognizedDependency struct { ModulePath string DependencyPath string TerragruntConfigPaths []string }
UnrecognizedDependency describes error when a dependency cannot be resolved
func (UnrecognizedDependency) Error ¶
func (err UnrecognizedDependency) Error() string