Documentation ¶
Index ¶
- Constants
- Variables
- type ActualCommand
- type ApprovalConfig
- type ApprovalConfigList
- func (list ApprovalConfigList) Enabled() ApprovalConfigList
- func (list ApprovalConfigList) Help(listOnly bool, lookups ...string) (result string)
- func (list *ApprovalConfigList) Merge(imported ApprovalConfigList)
- func (list ApprovalConfigList) ShouldBeApproved(command string) (bool, *ApprovalConfig)
- type Condition
- type ExportVariablesConfig
- type ExtraCommand
- type ExtraCommandList
- func (list ExtraCommandList) ActualCommand(cmd string) ActualCommand
- func (list ExtraCommandList) Enabled() ExtraCommandList
- func (list ExtraCommandList) GetVersions() string
- func (list ExtraCommandList) Help(listOnly bool, lookups ...string) (result string)
- func (list *ExtraCommandList) Merge(imported ExtraCommandList)
- type GenericItem
- type GenericItemList
- type Hook
- type HookFilter
- type HookList
- func (list HookList) Enabled() HookList
- func (list HookList) Filter(filter HookFilter) HookList
- func (list HookList) Help(listOnly bool, lookups ...string) (result string)
- func (list *HookList) MergeAppend(imported HookList)
- func (list *HookList) MergePrepend(imported HookList)
- func (list HookList) Run(status error, args ...interface{}) (result []interface{}, err error)
- type ImportFiles
- type ImportFilesList
- type ImportVariables
- type ImportVariablesList
- type IncludeConfig
- type ModuleDependencies
- type RunConditions
- type TerraformConfig
- type TerraformExtraArguments
- type TerraformExtraArgumentsList
- func (list TerraformExtraArgumentsList) Enabled() TerraformExtraArgumentsList
- func (list TerraformExtraArgumentsList) Filter(source string) (result []string, err error)
- func (list TerraformExtraArgumentsList) Help(listOnly bool, lookups ...string) (result string)
- func (list *TerraformExtraArgumentsList) Merge(imported TerraformExtraArgumentsList)
- type TerragruntConfig
- type TerragruntConfigFile
- type TerragruntExtensionBase
- type TerragruntExtensioner
- func IApprovalConfig(item interface{}) TerragruntExtensioner
- func IExtraCommand(item interface{}) TerragruntExtensioner
- func IGenericItem(item interface{}) TerragruntExtensioner
- func IHook(item interface{}) TerragruntExtensioner
- func IImportFiles(item interface{}) TerragruntExtensioner
- func IImportVariables(item interface{}) TerragruntExtensioner
- func ITerraformExtraArguments(item interface{}) TerragruntExtensioner
Constants ¶
const ( // DefaultConfigName is the name of the default file name where to store terragrunt definitions DefaultConfigName = options.DefaultConfigName // TerragruntScriptFolder is the name of the scripts folder generated under the temporary terragrunt folder TerragruntScriptFolder = ".terragrunt-scripts" )
Variables ¶
var AfterInitState = func(hook Hook) bool { return hook.AfterInitState && !hook.BeforeImports }
AfterInitState is a filter function
var BeforeImports = func(hook Hook) bool { return hook.BeforeImports }
BeforeImports is a filter function
var BeforeInitState = func(hook Hook) bool { return !hook.AfterInitState && !hook.BeforeImports }
BeforeInitState is a filter function
var TerraformCommandWithInput = []string{
"apply",
"import",
"init",
"plan",
"refresh",
}
TerraformCommandWithInput is the list of Terraform commands accepting --input
var TerraformCommandWithLockTimeout = []string{
"apply",
"destroy",
"import",
"init",
"plan",
"refresh",
"taint",
"untaint",
}
TerraformCommandWithLockTimeout is the list of Terraform commands accepting --lock-timeout
var TerraformCommandWithVarFile = []string{
"apply",
"console",
"destroy",
"import",
"plan",
"push",
"refresh",
"validate",
}
TerraformCommandWithVarFile is the list of Terraform commands accepting -var-file
var TitleID = color.New(color.FgHiYellow).SprintFunc()
TitleID add formating to the id of the elements
Functions ¶
This section is empty.
Types ¶
type ActualCommand ¶
type ActualCommand struct { Command string BehaveAs string Extra *ExtraCommand }
ActualCommand represents the command that should be executed
type ApprovalConfig ¶
type ApprovalConfig struct { TerragruntExtensionBase `hcl:",remain"` Commands []string `hcl:"commands"` ExpectStatements []string `hcl:"expect_statements"` CompletedStatements []string `hcl:"completed_statements"` }
ApprovalConfig represents an `expect` format configuration that instructs terragrunt to wait for input on an ExpectStatement and to exit the command on a CompletedStatement
func (ApprovalConfig) String ¶
func (item ApprovalConfig) String() string
type ApprovalConfigList ¶
type ApprovalConfigList []ApprovalConfig
ApprovalConfigList represents an array of ApprovalConfig
func (ApprovalConfigList) Enabled ¶
func (list ApprovalConfigList) Enabled() ApprovalConfigList
Enabled returns only the enabled items on the list
func (ApprovalConfigList) Help ¶
func (list ApprovalConfigList) Help(listOnly bool, lookups ...string) (result string)
Help returns the information relative to the elements within the list
func (*ApprovalConfigList) Merge ¶
func (list *ApprovalConfigList) Merge(imported ApprovalConfigList)
Merge elements from an imported list to the current list
func (ApprovalConfigList) ShouldBeApproved ¶
func (list ApprovalConfigList) ShouldBeApproved(command string) (bool, *ApprovalConfig)
ShouldBeApproved looks for an approval config that corresponds to the given command. If if exists, it's returned with the value `true`.
type ExportVariablesConfig ¶
type ExportVariablesConfig struct { Path string `hcl:"path"` Format string `hcl:"format,optional"` }
ExportVariablesConfig represents a path and format where variables known to Terragrunt should be exported
type ExtraCommand ¶
type ExtraCommand struct { TerragruntExtensionBase `hcl:",remain"` Commands []string `hcl:"commands,optional"` Aliases []string `hcl:"aliases,optional"` Arguments []string `hcl:"arguments,optional"` ExpandArgs *bool `hcl:"expand_args,optional"` UseState *bool `hcl:"use_state,optional"` ActAs string `hcl:"act_as,optional"` VersionArg string `hcl:"version,optional"` ShellCommand bool `hcl:"shell_command,optional"` // This indicates that the command is a shell command and output should not be redirected IgnoreError bool `hcl:"ignore_error,optional"` EnvVars map[string]string `hcl:"env_vars,optional"` }
ExtraCommand is a definition of user extra command that should be executed in place of terraform
type ExtraCommandList ¶
type ExtraCommandList []ExtraCommand
ExtraCommandList represents an array of ExtraCommand
func (ExtraCommandList) ActualCommand ¶
func (list ExtraCommandList) ActualCommand(cmd string) ActualCommand
ActualCommand returns
func (ExtraCommandList) Enabled ¶
func (list ExtraCommandList) Enabled() ExtraCommandList
Enabled returns only the enabled items on the list
func (ExtraCommandList) GetVersions ¶
func (list ExtraCommandList) GetVersions() string
GetVersions returns the the list of versions for extra commands that have a version available
func (ExtraCommandList) Help ¶
func (list ExtraCommandList) Help(listOnly bool, lookups ...string) (result string)
Help returns the information relative to the elements within the list
func (*ExtraCommandList) Merge ¶
func (list *ExtraCommandList) Merge(imported ExtraCommandList)
Merge elements from an imported list to the current list
type GenericItemList ¶
type GenericItemList []GenericItem
GenericItemList represents an array of GenericItem
func (GenericItemList) Enabled ¶
func (list GenericItemList) Enabled() GenericItemList
Enabled returns only the enabled items on the list
type Hook ¶
type Hook struct { TerragruntExtensionBase `hcl:",remain"` Command string `hcl:"command"` Arguments []string `hcl:"arguments,optional"` ExpandArgs bool `hcl:"expand_args,optional"` OnCommands []string `hcl:"on_commands,optional"` IgnoreError bool `hcl:"ignore_error,optional"` BeforeImports bool `hcl:"before_imports,optional"` AfterInitState bool `hcl:"after_init_state,optional"` Order int `hcl:"order,optional"` ShellCommand bool `hcl:"shell_command,optional"` // This indicates that the command is a shell command and output should not be redirected EnvVars map[string]string `hcl:"env_vars,optional"` PersistentEnvVars map[string]string `hcl:"persistent_env_vars,optional"` }
Hook is a definition of user command that should be executed as part of the terragrunt process
type HookFilter ¶
HookFilter is used to filter the hook on supplied criteria
type HookList ¶
type HookList []Hook
HookList represents an array of Hook
func (HookList) Filter ¶
func (list HookList) Filter(filter HookFilter) HookList
Filter returns a list of hook that match the supplied filter
func (*HookList) MergeAppend ¶
MergeAppend appends elements from an imported list to the current list
func (*HookList) MergePrepend ¶
MergePrepend prepends elements from an imported list to the current list
type ImportFiles ¶
type ImportFiles struct { TerragruntExtensionBase `hcl:",remain"` Source string `hcl:"source,optional"` Files []string `hcl:"files"` CopyAndRename []copyAndRename `hcl:"copy_and_remove,optional"` Required *bool `hcl:"required,optional"` ImportIntoModules bool `hcl:"import_into_modules,optional"` FileMode *int `hcl:"file_mode,optional"` Target string `hcl:"target,optional"` Prefix *string `hcl:"prefix,optional"` }
ImportFiles is a configuration of files that must be imported from another directory to the terraform directory prior executing terraform commands
type ImportFilesList ¶
type ImportFilesList []ImportFiles
ImportFilesList represents an array of ImportFiles
func (ImportFilesList) Enabled ¶
func (list ImportFilesList) Enabled() ImportFilesList
Enabled returns only the enabled items on the list
func (ImportFilesList) Help ¶
func (list ImportFilesList) Help(listOnly bool, lookups ...string) (result string)
Help returns the information relative to the elements within the list
func (*ImportFilesList) Merge ¶
func (list *ImportFilesList) Merge(imported ImportFilesList)
Merge elements from an imported list to the current list
type ImportVariables ¶
type ImportVariables struct { TerragruntExtensionBase `hcl:",remain"` Vars []string `hcl:"vars,optional"` RequiredVarFiles []string `hcl:"required_var_files,optional"` OptionalVarFiles []string `hcl:"optional_var_files,optional"` NoTemplating bool `hcl:"no_templating_in_files,optional"` Sources []string `hcl:"sources,optional"` NestedObjects []string `hcl:"nested_under,optional"` EnvVars map[string]string `hcl:"env_vars,optional"` OnCommands []string `hcl:"on_commands,optional"` }
ImportVariables is a configuration that allows defintion of variables that will be added to the current execution. Variables could be defined either by loading files (required or optional) or defining vairables directly. It is also possible to define global environment variables.
type ImportVariablesList ¶
type ImportVariablesList []ImportVariables
ImportVariablesList represents an array of ImportVariables
func (ImportVariablesList) Enabled ¶
func (list ImportVariablesList) Enabled() ImportVariablesList
Enabled returns only the enabled items on the list
func (ImportVariablesList) Help ¶
func (list ImportVariablesList) Help(listOnly bool, lookups ...string) (result string)
Help returns the information relative to the elements within the list
func (ImportVariablesList) Import ¶
func (list ImportVariablesList) Import() (err error)
Import actually process the variables importers to load and define all variables in the current context
func (*ImportVariablesList) Merge ¶
func (list *ImportVariablesList) Merge(imported ImportVariablesList)
Merge elements from an imported list to the current list
type IncludeConfig ¶
type IncludeConfig struct { Source string `hcl:"source,optional"` Path string `hcl:"path,optional"` // contains filtered or unexported fields }
IncludeConfig represents the configuration settings for a parent Terragrunt configuration file that you can "include" in a child Terragrunt configuration file
func (IncludeConfig) String ¶
func (include IncludeConfig) String() string
type ModuleDependencies ¶
type ModuleDependencies struct {
Paths []string `hcl:"paths"`
}
ModuleDependencies represents the paths to other Terraform modules that must be applied before the current module can be applied
func (*ModuleDependencies) String ¶
func (deps *ModuleDependencies) String() string
type RunConditions ¶
RunConditions defines the rules that are evaluated in order to determine
func (*RunConditions) Merge ¶
func (c *RunConditions) Merge(imported RunConditions)
Merge combines RunConditions from another source into the current one
func (RunConditions) ShouldRun ¶
func (c RunConditions) ShouldRun() bool
ShouldRun returns whether or not the current project should be run based on its run conditions and the variables in its options.
func (RunConditions) String ¶
func (c RunConditions) String() (result string)
type TerraformConfig ¶
type TerraformConfig struct { LegacyExtraArgs TerraformExtraArgumentsList `hcl:"extra_arguments,block"` // Kept here only for retro compatibility Source string `hcl:"source,optional"` }
TerraformConfig specifies where to find the Terraform configuration files
func (TerraformConfig) String ¶
func (conf TerraformConfig) String() string
type TerraformExtraArguments ¶
type TerraformExtraArguments struct { TerragruntExtensionBase `hcl:",remain"` Source string `hcl:"source,optional"` Arguments []string `hcl:"arguments,optional"` RequiredVarFiles []string `hcl:"required_var_files,optional"` OptionalVarFiles []string `hcl:"optional_var_files,optional"` Commands []string `hcl:"commands,optional"` EnvVars map[string]string `hcl:"env_vars,optional"` }
TerraformExtraArguments sets a list of arguments to pass to Terraform if command fits any in the `Commands` list
type TerraformExtraArgumentsList ¶
type TerraformExtraArgumentsList []TerraformExtraArguments
TerraformExtraArgumentsList represents an array of TerraformExtraArguments
func (TerraformExtraArgumentsList) Enabled ¶
func (list TerraformExtraArgumentsList) Enabled() TerraformExtraArgumentsList
Enabled returns only the enabled items on the list
func (TerraformExtraArgumentsList) Filter ¶
func (list TerraformExtraArgumentsList) Filter(source string) (result []string, err error)
Filter applies extra_arguments to the current configuration
func (TerraformExtraArgumentsList) Help ¶
func (list TerraformExtraArgumentsList) Help(listOnly bool, lookups ...string) (result string)
Help returns the information relative to the elements within the list
func (*TerraformExtraArgumentsList) Merge ¶
func (list *TerraformExtraArgumentsList) Merge(imported TerraformExtraArgumentsList)
Merge elements from an imported list to the current list
type TerragruntConfig ¶
type TerragruntConfig struct { ApprovalConfig ApprovalConfigList `hcl:"approval_config,block"` AssumeRole []string AssumeRoleDurationHours *int `hcl:"assume_role_duration_hours,attr"` Dependencies *ModuleDependencies `hcl:"dependencies,block"` Description string `hcl:"description,optional"` ExportVariablesConfigs []ExportVariablesConfig `hcl:"export_variables,block"` ExtraArgs TerraformExtraArgumentsList `hcl:"extra_arguments,block"` ExtraCommands ExtraCommandList `hcl:"extra_command,block"` ImportFiles ImportFilesList `hcl:"import_files,block"` ImportVariables ImportVariablesList `hcl:"import_variables,block"` Inputs map[string]interface{} PreHooks HookList `hcl:"pre_hook,block"` PostHooks HookList `hcl:"post_hook,block"` RemoteState *remote.State `hcl:"remote_state,block"` RunConditions RunConditions Terraform *TerraformConfig `hcl:"terraform,block"` UniquenessCriteria *string `hcl:"uniqueness_criteria,attr"` AssumeRoleHclDefinition cty.Value `hcl:"assume_role,optional"` InputsHclDefinition cty.Value `hcl:"inputs,optional"` RunConditionsHclDefinition []runConditionsHclDefinition `hcl:"run_conditions,block"` // contains filtered or unexported fields }
TerragruntConfig represents a parsed and expanded configuration
func ParseConfigFile ¶
func ParseConfigFile(terragruntOptions *options.TerragruntOptions, include IncludeConfig) (configString string, config *TerragruntConfig, err error)
ParseConfigFile parses the Terragrunt config file at the given path. If the include parameter is not nil, then treat this as a config included in some other config file when resolving relative paths.
func ReadTerragruntConfig ¶
func ReadTerragruntConfig(terragruntOptions *options.TerragruntOptions) (*TerragruntConfig, error)
ReadTerragruntConfig reads the Terragrunt config file from its default location
func (*TerragruntConfig) ExportVariables ¶
func (conf *TerragruntConfig) ExportVariables(existingTerraformVariables map[string]*configs.Variable, folders ...string) (err error)
ExportVariables saves variables to paths defined in the export_variables blocks
func (TerragruntConfig) ExtraArguments ¶
func (conf TerragruntConfig) ExtraArguments(source string) ([]string, error)
ExtraArguments processes the extra_arguments defined in the terraform section of the config file
func (TerragruntConfig) String ¶
func (conf TerragruntConfig) String() string
type TerragruntConfigFile ¶
type TerragruntConfigFile struct { Path string // remain will send everything that isn't match into the labelled struct // In that case, most of the config goes down to TerragruntConfig // https://godoc.org/github.com/hashicorp/hcl/v2/gohcl TerragruntConfig `hcl:",remain"` Include *IncludeConfig `hcl:"include,block"` }
TerragruntConfigFile represents the configuration supported in a Terragrunt configuration file (i.e. terragrunt.hcl)
func (*TerragruntConfigFile) GetSourceFolder ¶
func (tcf *TerragruntConfigFile) GetSourceFolder(name string, source string, failIfNotFound bool) (string, error)
GetSourceFolder resolves remote source and returns the local temporary folder If the source is local, it is directly returned
func (TerragruntConfigFile) String ¶
func (tcf TerragruntConfigFile) String() string
type TerragruntExtensionBase ¶
type TerragruntExtensionBase struct { Name string `hcl:"name,label"` DisplayName string `hcl:"display_name,optional"` Description string `hcl:"description,optional"` OS []string `hcl:"os,optional"` Disabled bool `hcl:"disabled,optional"` // contains filtered or unexported fields }
TerragruntExtensionBase is the base object to define object used to extend the behavior of terragrunt
func (TerragruntExtensionBase) String ¶
func (base TerragruntExtensionBase) String() string
type TerragruntExtensioner ¶
type TerragruntExtensioner interface {
// contains filtered or unexported methods
}
TerragruntExtensioner defines the interface that must be implemented by Terragrunt Extension objects
func IApprovalConfig ¶
func IApprovalConfig(item interface{}) TerragruntExtensioner
IApprovalConfig returns TerragruntExtensioner from the supplied type
func IExtraCommand ¶
func IExtraCommand(item interface{}) TerragruntExtensioner
IExtraCommand returns TerragruntExtensioner from the supplied type
func IGenericItem ¶
func IGenericItem(item interface{}) TerragruntExtensioner
IGenericItem returns TerragruntExtensioner from the supplied type
func IHook ¶
func IHook(item interface{}) TerragruntExtensioner
IHook returns TerragruntExtensioner from the supplied type
func IImportFiles ¶
func IImportFiles(item interface{}) TerragruntExtensioner
IImportFiles returns TerragruntExtensioner from the supplied type
func IImportVariables ¶
func IImportVariables(item interface{}) TerragruntExtensioner
IImportVariables returns TerragruntExtensioner from the supplied type
func ITerraformExtraArguments ¶
func ITerraformExtraArguments(item interface{}) TerragruntExtensioner
ITerraformExtraArguments returns TerragruntExtensioner from the supplied type
Source Files ¶
- config.go
- config_conditions.go
- config_export_variables.go
- config_helpers.go
- extension_approval_config.go
- extension_base.go
- extension_base_list.go
- extension_extra_args.go
- extension_extra_command.go
- extension_hook.go
- extension_import_files.go
- extension_import_variables.go
- generated_approval_config.go
- generated_extra_args.go
- generated_extra_command.go
- generated_hooks.go
- generated_import_files.go
- generated_import_variables.go