Documentation ¶
Index ¶
- Constants
- Variables
- func CheckTerraformVersion(constraint string, terragruntOptions *options.TerragruntOptions) error
- func CheckTerragruntVersion(constraint string, terragruntOptions *options.TerragruntOptions) error
- func NewCommand(opts *options.TerragruntOptions) *cli.Command
- func PopulateTerraformVersion(ctx context.Context, terragruntOptions *options.TerragruntOptions) error
- func Run(ctx context.Context, opts *options.TerragruntOptions) error
- func RunWithTarget(ctx context.Context, opts *options.TerragruntOptions, target *Target) error
- func WriteTerragruntDebugFile(terragruntOptions *options.TerragruntOptions, ...) error
- type BackendNotDefined
- type DownloadingTerraformSourceErr
- type FileCopyGetter
- type InvalidTerraformVersion
- type InvalidTerraformVersionSyntax
- type InvalidTerragruntVersion
- type MaxRetriesExceeded
- type MissingCommand
- type ModuleIsProtected
- type NoTerraformFilesFound
- type Target
- type TargetCallbackType
- type TargetErrorCallbackType
- type TargetPointType
- type WorkingDirNotDir
- type WorkingDirNotFound
- type WrongTerraformCommand
Constants ¶
const ( CommandNameTerragruntReadConfig = "terragrunt-read-config" NullTFVarsFile = ".terragrunt-null-vars.auto.tfvars.json" )
const ( CommandName = "" CommandHelpName = "*" )
const ( HookCtxTFPathEnvName = "TG_CTX_TF_PATH" HookCtxCommandEnvName = "TG_CTX_COMMAND" HookCtxHookNameEnvName = "TG_CTX_HOOK_NAME" )
const DefaultTerraformVersionConstraint = ">= v0.12.0"
This uses the constraint syntax from https://github.com/hashicorp/go-version This version of Terragrunt was tested to work with Terraform 0.12.0 and above only
const MODULE_MANIFEST_NAME = ".terragrunt-module-manifest"
manifest for files copied from terragrunt module folder (i.e., the folder that contains the current terragrunt.hcl)
const SourceManifestName = ".terragrunt-source-manifest"
manifest for files copied from the URL specified in the terraform { source = "<URL>" } config
const TerraformExtensionGlob = "*.tf"
const TerragruntTFVarsFile = "terragrunt-debug.tfvars.json"
Variables ¶
var ModuleRegex = regexp.MustCompile(`module[[:blank:]]+".+"`)
var TerraformCommandsThatDoNotNeedInit = []string{
"version",
"terragrunt-info",
"graph-dependencies",
}
var TerraformCommandsThatUseState = []string{
"init",
"apply",
"destroy",
"env",
"import",
"graph",
"output",
"plan",
"push",
"refresh",
"show",
"taint",
"untaint",
"validate",
"force-unlock",
"state",
}
var TerraformVersionRegex = regexp.MustCompile(`^(\S+)\s(v?\d+\.\d+\.\d+)`)
TerraformVersionRegex verifies that terraform --version output is in one of the following formats: - OpenTofu v1.6.0-dev - Terraform v0.9.5-dev (cad024a5fe131a546936674ef85445215bbc4226+CHANGES) - Terraform v0.13.0-beta2 - Terraform v0.12.27 We only make sure the "v#.#.#" part is present in the output.
Functions ¶
func CheckTerraformVersion ¶
func CheckTerraformVersion(constraint string, terragruntOptions *options.TerragruntOptions) error
Check that the currently installed Terraform version works meets the specified version constraint and return an error if it doesn't
func CheckTerragruntVersion ¶
func CheckTerragruntVersion(constraint string, terragruntOptions *options.TerragruntOptions) error
Check that the currently running Terragrunt version meets the specified version constraint and return an error if it doesn't
func NewCommand ¶
func NewCommand(opts *options.TerragruntOptions) *cli.Command
func PopulateTerraformVersion ¶
func PopulateTerraformVersion(ctx context.Context, terragruntOptions *options.TerragruntOptions) error
Populate the currently installed version of Terraform into the given terragruntOptions
func Run ¶
func Run(ctx context.Context, opts *options.TerragruntOptions) error
Run downloads terraform source if necessary, then runs terraform with the given options and CLI args. This will forward all the args and extra_arguments directly to Terraform.
func RunWithTarget ¶
func WriteTerragruntDebugFile ¶
func WriteTerragruntDebugFile(terragruntOptions *options.TerragruntOptions, terragruntConfig *config.TerragruntConfig) error
WriteTerragruntDebugFile will create a tfvars file that can be used to invoke the terraform module in the same way that terragrunt invokes the module, so that you can debug issues with the terragrunt config.
Types ¶
type BackendNotDefined ¶
type BackendNotDefined struct { Opts *options.TerragruntOptions BackendType string }
func (BackendNotDefined) Error ¶
func (err BackendNotDefined) Error() string
type DownloadingTerraformSourceErr ¶ added in v0.54.7
func (DownloadingTerraformSourceErr) Error ¶ added in v0.54.7
func (err DownloadingTerraformSourceErr) Error() string
type FileCopyGetter ¶
type FileCopyGetter struct { getter.FileGetter // List of glob paths that should be included in the copy. This can be used to override the default behavior of // Terragrunt, which will skip hidden folders. IncludeInCopy []string }
A custom getter.Getter implementation that uses file copying instead of symlinks. Symlinks are faster and use less disk space, but they cause issues in Windows and with infinite loops, so we copy files/folders instead.
type InvalidTerraformVersion ¶
type InvalidTerraformVersion struct { CurrentVersion *version.Version VersionConstraints version.Constraints }
func (InvalidTerraformVersion) Error ¶
func (err InvalidTerraformVersion) Error() string
type InvalidTerraformVersionSyntax ¶
type InvalidTerraformVersionSyntax string
func (InvalidTerraformVersionSyntax) Error ¶
func (err InvalidTerraformVersionSyntax) Error() string
type InvalidTerragruntVersion ¶
type InvalidTerragruntVersion struct { CurrentVersion *version.Version VersionConstraints version.Constraints }
func (InvalidTerragruntVersion) Error ¶
func (err InvalidTerragruntVersion) Error() string
type MaxRetriesExceeded ¶
type MaxRetriesExceeded struct {
Opts *options.TerragruntOptions
}
func (MaxRetriesExceeded) Error ¶
func (err MaxRetriesExceeded) Error() string
type MissingCommand ¶
type MissingCommand struct{}
func (MissingCommand) Error ¶
func (err MissingCommand) Error() string
type ModuleIsProtected ¶
type ModuleIsProtected struct {
Opts *options.TerragruntOptions
}
func (ModuleIsProtected) Error ¶
func (err ModuleIsProtected) Error() string
type NoTerraformFilesFound ¶
type NoTerraformFilesFound string
func (NoTerraformFilesFound) Error ¶
func (path NoTerraformFilesFound) Error() string
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
func NewTarget ¶
func NewTarget(point TargetPointType, callbackFunc TargetCallbackType) *Target
func NewTargetWithErrorHandler ¶ added in v0.56.1
func NewTargetWithErrorHandler(point TargetPointType, callbackFunc TargetCallbackType, errorCallbackFunc TargetErrorCallbackType) *Target
type TargetCallbackType ¶
type TargetCallbackType func(ctx context.Context, opts *options.TerragruntOptions, config *config.TerragruntConfig) error
type TargetErrorCallbackType ¶ added in v0.56.1
type TargetErrorCallbackType func(opts *options.TerragruntOptions, config *config.TerragruntConfig, e error) error
type TargetPointType ¶
type TargetPointType byte
const ( TargetPointParseConfig TargetPointType = iota + 1 TargetPointDownloadSource TargetPointGenerateConfig TargetPointInitCommand )
type WorkingDirNotDir ¶
func (WorkingDirNotDir) Error ¶
func (err WorkingDirNotDir) Error() string
type WorkingDirNotFound ¶
func (WorkingDirNotFound) Error ¶
func (err WorkingDirNotFound) Error() string
type WrongTerraformCommand ¶ added in v0.50.5
type WrongTerraformCommand string
func (WrongTerraformCommand) Error ¶ added in v0.50.5
func (name WrongTerraformCommand) Error() string