config

package
v0.12.25-coveo.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTerragruntConfigPath = "terraform.tfvars"
View Source
const GET_SCRIPT_FOLDER = "<SCRIPT_FOLDER>"
View Source
const GET_TEMP_FOLDER = "<TEMP_FOLDER>"
View Source
const OldTerragruntConfigPath = ".terragrunt"
View Source
const TerragruntScriptFolder = ".terragrunt-scripts"

Variables

View Source
var HELPER_FUNCTION_SYNTAX_REGEX = regexp.MustCompile(`^\$\{\s*(.*?)\((.*?)\)\s*\}$`)
View Source
var HELPER_VAR_REGEX = regexp.MustCompile(fmt.Sprintf(`\$\{%s\}`, INTERPOLATION_VARS))
View Source
var INTERPOLATION_PARAMETERS = fmt.Sprintf(`(\s*(%s)\s*,?\s*)*`, getVarParams(1))
View Source
var INTERPOLATION_SYNTAX_REGEX = regexp.MustCompile(fmt.Sprintf(`\$\{\s*(\w+\(%s\)|%s)\s*\}`, INTERPOLATION_PARAMETERS, INTERPOLATION_VARS))
View Source
var INTERPOLATION_SYNTAX_REGEX_REMAINING = regexp.MustCompile(`\$\{.*?\}`)
View Source
var INTERPOLATION_SYNTAX_REGEX_SINGLE = regexp.MustCompile(fmt.Sprintf(`"(%s)"`, INTERPOLATION_SYNTAX_REGEX))
View Source
var INTERPOLATION_VARS = `\s*var\.([[:alpha:]][\w-]*)\s*`
View Source
var MAX_PARENT_FOLDERS_TO_CHECK = 100
View Source
var TERRAFORM_COMMANDS_NEED_INPUT = []string{
	"apply",
	"import",
	"init",
	"plan",
	"refresh",
}

List of terraform commands that accept -input=

View Source
var TERRAFORM_COMMANDS_NEED_LOCKING = []string{
	"apply",
	"destroy",
	"import",
	"init",
	"plan",
	"refresh",
	"taint",
	"untaint",
}

List of terraform commands that accept -lock-timeout

View Source
var TERRAFORM_COMMANDS_NEED_VARS = []string{
	"apply",
	"console",
	"destroy",
	"import",
	"plan",
	"push",
	"refresh",
}

List of terraform commands that accept -var or -var-file

Functions

func DefaultConfigPath added in v0.10.0

func DefaultConfigPath(workingDir string) string

Returns the default path to use for the Terragrunt configuration file. The reason this is a method rather than a constant is that older versions of Terragrunt stored configuration in a different file. This method returns the path to the old configuration format if such a file exists and the new format otherwise.

func FindConfigFilesInPath added in v0.10.0

func FindConfigFilesInPath(terragruntOptions *options.TerragruntOptions) ([]string, error)

Returns a list of all Terragrunt config files in the given path or any subfolder of the path. A file is a Terragrunt config file if it has a name as returned by the DefaultConfigPath method and contains Terragrunt config contents as returned by the IsTerragruntConfigFile method.

func IsTerragruntConfigFile added in v0.10.0

func IsTerragruntConfigFile(path string) (bool, error)

Returns true if the given path corresponds to file that could be a Terragrunt config file. A file could be a Terragrunt config file if:

1. The file exists 2. It is a .terragrunt file, which is the old Terragrunt-specific file format 3. The file contains HCL contents with a terragrunt = { ... } block

func ResolveTerragruntConfigString added in v0.4.0

func ResolveTerragruntConfigString(terragruntConfigString string, include IncludeConfig, terragruntOptions *options.TerragruntOptions) (string, error)

Given a string value from a Terragrunt configuration, parse the string, resolve any calls to helper functions using the syntax ${...}, and return the final value.

func SubstituteVars added in v1.0.0

func SubstituteVars(str string, terragruntOptions *options.TerragruntOptions) string

SubstituteVars substitutes any variables in the string if there is a value associated with the variable

Types

type CheckedTooManyParentFolders added in v0.4.0

type CheckedTooManyParentFolders string

func (CheckedTooManyParentFolders) Error added in v0.4.0

func (err CheckedTooManyParentFolders) Error() string

type CopyAndRename

type CopyAndRename struct {
	Source string `hcl:"source"`
	Target string `hcl:"target"`
}

CopyAndRename is a structure used by ImportConfig to rename the imported files

type CouldNotResolveTerragruntConfigInFile added in v0.10.0

type CouldNotResolveTerragruntConfigInFile string

func (CouldNotResolveTerragruntConfigInFile) Error added in v0.10.0

type EnvVar added in v0.9.1

type EnvVar struct {
	Name         string
	DefaultValue string
}

type ErrorOnDiscovery

type ErrorOnDiscovery struct {
	// contains filtered or unexported fields
}

func (ErrorOnDiscovery) Error

func (err ErrorOnDiscovery) Error() string

type ExtraCommand added in v1.0.0

type ExtraCommand struct {
	Name       string   `hcl:",key"`
	Commands   []string `hcl:"commands,omitempty"`
	OnCommands []string `hcl:"on_commands,omitempty"`
	OS         []string `hcl:"os,omitempty"`
	UseState   *bool    `hcl:"use_state,omitempty"`
	Aliases    []string `hcl:"aliases,omitempty"`
	Arguments  []string `hcl:"arguments,omitempty"`
}

ExtraCommand is a definition of user extra command that should be executed in place of terraform

func (*ExtraCommand) String

func (command *ExtraCommand) String() string

type Hook added in v1.0.0

type Hook struct {
	Name        string   `hcl:",key"`
	Command     string   `hcl:"command"`
	OnCommands  []string `hcl:"on_commands,omitempty"`
	OS          []string `hcl:"os,omitempty"`
	Arguments   []string `hcl:"arguments,omitempty"`
	ExpandArgs  bool     `hcl:"expand_args,omitempty"`
	IgnoreError bool     `hcl:"ignore_error,omitempty"`
}

Hook is a definition of user command that should be executed as part of the terragrunt process

func (*Hook) String

func (hook *Hook) String() string

type ImportConfig

type ImportConfig struct {
	Name               string          `hcl:",key"`
	Source             string          `hcl:"source"`
	Files              []string        `hcl:"files"`
	CopyAndRenameFiles []CopyAndRename `hcl:"copy_and_rename"`
	Required           *bool           `hcl:"required,omitempty"`
	ImportIntoModules  bool            `hcl:"import_into_modules"`
	FileMode           *int            `hcl:"file_mode, omitempty"`
	Target             string          `hcl:"target, omitempty"`
	Prefix             *string         `hcl:"prefix, omitempty"`
	OS                 []string        `hcl:"os,omitempty"`
}

ImportConfig is a configuration of files that must be imported from another directory to the terraform directory prior executing terraform commands

func (ImportConfig) String

func (importConfig ImportConfig) String() string

type IncludeConfig added in v0.4.0

type IncludeConfig struct {
	Source    string `hcl:"source"`
	Path      string `hcl:"path"`
	IncludeBy *IncludeConfig
}

IncludeConfig represents the configuration settings for a parent Terragrunt configuration file that you can "include" in a child Terragrunt configuration file

func (IncludeConfig) String added in v1.0.0

func (include IncludeConfig) String() string

type IncludedConfigMissingPath added in v0.4.0

type IncludedConfigMissingPath string

func (IncludedConfigMissingPath) Error added in v0.4.0

func (err IncludedConfigMissingPath) Error() string

type InvalidDefaultParameters

type InvalidDefaultParameters string

func (InvalidDefaultParameters) Error

func (err InvalidDefaultParameters) Error() string

type InvalidDiscoveryParameters

type InvalidDiscoveryParameters string

func (InvalidDiscoveryParameters) Error

func (err InvalidDiscoveryParameters) Error() string

type InvalidGetEnvParameters

type InvalidGetEnvParameters string

func (InvalidGetEnvParameters) Error

func (err InvalidGetEnvParameters) Error() string

type InvalidInterpolationSyntax added in v0.4.0

type InvalidInterpolationSyntax string

func (InvalidInterpolationSyntax) Error added in v0.4.0

func (err InvalidInterpolationSyntax) Error() string

type InvalidSaveVariablesParameters

type InvalidSaveVariablesParameters string

func (InvalidSaveVariablesParameters) Error

type LockConfig added in v0.1.0

type LockConfig map[interface{}]interface{}

Older versions of Terraform did not support locking, so Terragrunt offered locking as a feature. As of version 0.9.0, Terraform supports locking natively, so this feature was removed from Terragrunt. However, we keep around the LockConfig so we can log a warning for Terragrunt users who are still trying to use it.

type ModuleDependencies added in v0.6.0

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 added in v0.9.4

func (deps *ModuleDependencies) String() string

type ParentTerragruntConfigNotFound added in v0.4.0

type ParentTerragruntConfigNotFound string

func (ParentTerragruntConfigNotFound) Error added in v0.4.0

type TerraformConfig added in v0.9.4

type TerraformConfig struct {
	ExtraArgs []TerraformExtraArguments `hcl:"extra_arguments"`
	Source    string                    `hcl:"source"`
}

TerraformConfig specifies where to find the Terraform configuration files

func (*TerraformConfig) String added in v0.9.4

func (conf *TerraformConfig) String() string

type TerraformExtraArguments added in v0.10.2

type TerraformExtraArguments struct {
	Name             string   `hcl:",key"`
	Arguments        []string `hcl:"arguments,omitempty"`
	Vars             []string `hcl:"vars,omitempty"`
	RequiredVarFiles []string `hcl:"required_var_files,omitempty"`
	OptionalVarFiles []string `hcl:"optional_var_files,omitempty"`
	Commands         []string `hcl:"commands,omitempty"`
}

TerraformExtraArguments sets a list of arguments to pass to Terraform if command fits any in the `Commands` list

func (*TerraformExtraArguments) String added in v0.10.2

func (conf *TerraformExtraArguments) String() string

type TerragruntConfig

type TerragruntConfig struct {
	Terraform     *TerraformConfig
	RemoteState   *remote.RemoteState
	Dependencies  *ModuleDependencies
	Uniqueness    *string
	PreHooks      []Hook
	PostHooks     []Hook
	ExtraCommands []ExtraCommand
	ImportFiles   []ImportConfig
	AssumeRole    *string
}

TerragruntConfig represents a parsed and expanded configuration

func ParseConfigFile added in v0.6.0

func ParseConfigFile(terragruntOptions *options.TerragruntOptions, include IncludeConfig) (*TerragruntConfig, error)

Parse 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)

Read the Terragrunt config file from its default location

func (*TerragruntConfig) String added in v0.9.4

func (conf *TerragruntConfig) String() string

func (*TerragruntConfig) SubstituteAllVariables added in v1.0.0

func (conf *TerragruntConfig) SubstituteAllVariables(terragruntOptions *options.TerragruntOptions, substituteFolders bool)

SubstituteAllVariables replace all remaining variables by the value

type UnknownHelperFunction added in v0.4.0

type UnknownHelperFunction string

func (UnknownHelperFunction) Error added in v0.4.0

func (err UnknownHelperFunction) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL