Documentation
¶
Index ¶
- type ExecutionOptions
- type ExecutionResult
- type ModuleExecResult
- type ModulePlan
- type PlanSummary
- type RunAllExecutor
- type RunAllOptions
- type RunAllResult
- type TerraformChanges
- type TerragruntExecutor
- func (te *TerragruntExecutor) GetExecutionHistory() []ExecutionResult
- func (te *TerragruntExecutor) Run(ctx context.Context, configPath string, opts ExecutionOptions) (*ExecutionResult, error)
- func (te *TerragruntExecutor) RunAll(ctx context.Context, opts ExecutionOptions) ([]ExecutionResult, error)
- func (te *TerragruntExecutor) SetAutoApprove(enabled bool)
- func (te *TerragruntExecutor) SetEnvVar(key, value string)
- func (te *TerragruntExecutor) SetLogLevel(level string)
- func (te *TerragruntExecutor) SetNonInteractive(enabled bool)
- func (te *TerragruntExecutor) SetParallelism(parallelism int)
- func (te *TerragruntExecutor) StreamOutput(ctx context.Context, configPath string, opts ExecutionOptions, ...) error
- func (te *TerragruntExecutor) ValidateAll(ctx context.Context) ([]ValidationResult, error)
- type ValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionOptions ¶
type ExecutionOptions struct {
Command string `json:"command"`
Args []string `json:"args"`
TargetPaths []string `json:"target_paths,omitempty"`
ExcludePaths []string `json:"exclude_paths,omitempty"`
IncludeDepends bool `json:"include_depends"`
IgnoreDependencyErrors bool `json:"ignore_dependency_errors"`
Parallelism int `json:"parallelism"`
RetryMaxAttempts int `json:"retry_max_attempts"`
RetryInterval time.Duration `json:"retry_interval"`
}
type ExecutionResult ¶
type ExecutionResult struct {
ConfigPath string `json:"config_path"`
Command string `json:"command"`
Args []string `json:"args"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
ExitCode int `json:"exit_code"`
Output string `json:"output"`
Error string `json:"error,omitempty"`
Dependencies []string `json:"dependencies"`
RetryCount int `json:"retry_count"`
}
type ModuleExecResult ¶
type ModuleExecResult struct {
Module string `json:"module"`
Status resolver.ModuleStatus `json:"status"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
Command string `json:"command"`
Output string `json:"output"`
Error error `json:"error,omitempty"`
ExitCode int `json:"exit_code"`
Changes *TerraformChanges `json:"changes,omitempty"`
}
ModuleExecResult contains the result of executing a single module
type ModulePlan ¶
type ModulePlan struct {
Path string `json:"path"`
Dependencies []string `json:"dependencies"`
Dependents []string `json:"dependents"`
Skipped bool `json:"skipped"`
}
ModulePlan contains plan information for a single module
type PlanSummary ¶
type PlanSummary struct {
TotalModules int `json:"total_modules"`
ExecutionOrder *resolver.ExecutionOrder `json:"execution_order"`
Parallelism int `json:"parallelism"`
Command string `json:"command"`
Modules []ModulePlan `json:"modules"`
}
PlanSummary contains a summary of the execution plan
type RunAllExecutor ¶ added in v1.1.0
type RunAllExecutor struct {
// contains filtered or unexported fields
}
RunAllExecutor executes terragrunt commands across modules
func NewRunAllExecutor ¶ added in v1.1.0
func NewRunAllExecutor(options *RunAllOptions) *RunAllExecutor
NewRunAllExecutor creates a new run-all executor
func (*RunAllExecutor) Cancel ¶ added in v1.1.0
func (e *RunAllExecutor) Cancel()
Cancel cancels the execution
func (*RunAllExecutor) GeneratePlanSummary ¶ added in v1.1.0
func (e *RunAllExecutor) GeneratePlanSummary(rootDir string) (*PlanSummary, error)
GeneratePlanSummary generates a summary of the execution plan
func (*RunAllExecutor) GetProgress ¶ added in v1.1.0
func (e *RunAllExecutor) GetProgress() map[string]interface{}
GetProgress returns current execution progress
func (*RunAllExecutor) RunAll ¶ added in v1.1.0
func (e *RunAllExecutor) RunAll(rootDir string) (*RunAllResult, error)
RunAll executes the command across all modules
type RunAllOptions ¶
type RunAllOptions struct {
Command string `json:"command"` // Terraform command to run (plan, apply, destroy, etc.)
Args []string `json:"args"` // Additional arguments
Parallelism int `json:"parallelism"` // Max parallel executions
IgnoreErrors bool `json:"ignore_errors"` // Continue on error
IgnoreDependencies bool `json:"ignore_dependencies"` // Ignore dependency order
IncludeSkipped bool `json:"include_skipped"` // Include skipped modules
TargetModules []string `json:"target_modules"` // Specific modules to target
ExcludeModules []string `json:"exclude_modules"` // Modules to exclude
Environment map[string]string `json:"environment"` // Environment variables
Timeout time.Duration `json:"timeout"` // Timeout per module
DryRun bool `json:"dry_run"` // Don't actually execute
AutoApprove bool `json:"auto_approve"` // Auto-approve for apply/destroy
}
RunAllOptions configures the run-all execution
type RunAllResult ¶
type RunAllResult struct {
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
ModuleResults map[string]*ModuleExecResult `json:"module_results"`
SuccessCount int `json:"success_count"`
FailureCount int `json:"failure_count"`
SkippedCount int `json:"skipped_count"`
ExecutionOrder *resolver.ExecutionOrder `json:"execution_order"`
Errors []error `json:"errors,omitempty"`
}
RunAllResult contains the results of a run-all execution
type TerraformChanges ¶
type TerraformChanges struct {
Add int `json:"add"`
Change int `json:"change"`
Destroy int `json:"destroy"`
}
TerraformChanges represents changes detected by terraform
type TerragruntExecutor ¶
type TerragruntExecutor struct {
// contains filtered or unexported fields
}
func NewTerragruntExecutor ¶
func NewTerragruntExecutor(parser *parser.TerragruntParser, workDir string) *TerragruntExecutor
func (*TerragruntExecutor) GetExecutionHistory ¶
func (te *TerragruntExecutor) GetExecutionHistory() []ExecutionResult
func (*TerragruntExecutor) Run ¶
func (te *TerragruntExecutor) Run(ctx context.Context, configPath string, opts ExecutionOptions) (*ExecutionResult, error)
func (*TerragruntExecutor) RunAll ¶
func (te *TerragruntExecutor) RunAll(ctx context.Context, opts ExecutionOptions) ([]ExecutionResult, error)
func (*TerragruntExecutor) SetAutoApprove ¶
func (te *TerragruntExecutor) SetAutoApprove(enabled bool)
func (*TerragruntExecutor) SetEnvVar ¶
func (te *TerragruntExecutor) SetEnvVar(key, value string)
func (*TerragruntExecutor) SetLogLevel ¶
func (te *TerragruntExecutor) SetLogLevel(level string)
func (*TerragruntExecutor) SetNonInteractive ¶
func (te *TerragruntExecutor) SetNonInteractive(enabled bool)
func (*TerragruntExecutor) SetParallelism ¶
func (te *TerragruntExecutor) SetParallelism(parallelism int)
func (*TerragruntExecutor) StreamOutput ¶
func (te *TerragruntExecutor) StreamOutput(ctx context.Context, configPath string, opts ExecutionOptions, outputChan chan<- string) error
func (*TerragruntExecutor) ValidateAll ¶
func (te *TerragruntExecutor) ValidateAll(ctx context.Context) ([]ValidationResult, error)