# Functions
AsTerraformEnvVarJSONValue converts the given value to a JSON value that can be passed to Terraform as an environment variable.
CanonicalPath returns the canonical version of the given path, relative to the given base path.
CanonicalPaths returns the canonical version of the given paths, relative to the given base path.
CleanPath is a wrapper around filepath.Clean.
CommaSeparatedStrings returns an HCL compliant formatted list of strings (each string within double quote).
ContainsPath returns true if path contains the given subpath E.g.
Copy is a io.Copy cancellable by context.
CopyFile copies a file from source to destination.
CopyFolderContents copies the files and folders within the source folder into the destination folder.
CopyFolderContentsWithFilter copies the files and folders within the source folder into the destination folder.
DoWithRetry runs the specified action.
EncodeBase64Sha1 Returns the base 64 encoded sha1 hash of the given string.
EnsureDirectory creates a directory at this path if it does not exist, or error if the path exists and is a file.
FileExists returns true if the given file exists.
FileNotExists returns true if the given file does not exist.
FileOrData will read the contents of the data of the given arg if it is a file, and otherwise return the contents by itself.
FileSHA256 calculates the SHA256 hash of the file at the given path.
FirstElement returns the first element from the given `list`.
No description provided by the author
GetCacheDir returns the global terragrunt cache directory for the current user.
GetElement returns the element with the specified `index` from the given `list`.
GetExcludeDirsFromFile returns a list of directories from the given filename, where each directory path starts on a new line.
GetExitCode returns the exit code of a command.
GetPathRelativeTo returns the relative path you would have to take to get from basePath to path.
GetRandomTime gets a random time duration between the lower bound and upper bound.
GetTempDir returns the global terragrunt temp directory.
GlobCanonicalPath returns the canonical versions of the given glob paths, relative to the given base path.
Grep returns true if the given regex can be found in any of the files matched by the given glob.
HasPathPrefix returns true if path starts with the given path prefix E.g.
IsCommandExecutable - returns true if a command can be executed without errors.
IsDir returns true if the path points to a directory.
IsDirectoryEmpty - returns true if the given path exists and is a empty directory.
IsFile returns true if the path points to a file.
IsSymLink returns true if the given file is a symbolic link Per https://stackoverflow.com/a/18062079/2308858.
JoinPath is a wrapper around filepath.Join
Windows systems use \ as the path separator *nix uses / Use this function when joining paths to force the returned path to use / as the path separator This will improve cross-platform compatibility.
JoinTerraformModulePath joins two paths together with a double-slash between them, as this is what Terraform uses to identify where a "repo" ends and a path within the repo begins.
KindOf returns the kind of the type or Invalid if value is nil.
LastElement returns the last element from the given `list`.
ListContainsElement returns true if the given list contains the given element.
ListContainsSublist returns true if an instance of the sublist can be found in the given list.
ListEquals returns true if the two lists are equal.
ListHasPrefix returns true if list starts with the given prefix list.
ListTfFiles returns a list of all TF files in the specified directory.
No description provided by the author
MatchSha256Checksum returns the SHA256 checksum for the given file and filename.
MergeStringSlices combines two string slices removing duplicates.
No description provided by the author
MustWalkTerraformOutput is a helper utility to deeply return a value from a terraform output.
No description provided by the author
NewKeyLocks creates a new instance of KeyLocks.
No description provided by the author
NewTrapWriter returns a new TrapWriter instance.
No description provided by the author
No description provided by the author
ReadFileAsString returns the contents of the file at the given path as a string.
RemoveDuplicatesFromList returns a copy of the given list with all duplicates removed (keeping the first encountereds).
RemoveDuplicatesFromListKeepLast returns a copy of the given list with all duplicates removed (keeping the last encountereds).
RemoveElementFromList returns a copy of the given list with all instances of the given element removed.
RemoveEmptyElements returns a copy of the given list without empty elements.
RemoveSublistFromList returns a copy of the given list with all instances of the given sublist removed.
SecondElement returns the second element from the given `list`.
SplitComma splits the given string by comma and returns a slice of the substrings.
SplitPath splits the given path into a list.
SplitUrls slices s into all substrings separated by sep and returns a slice of the substrings between those separators.
StringListInsert will insert the given string in to the provided string list at the specified index and return the new list of strings.
No description provided by the author
UniqueID returns a unique (ish) id we can use to name resources so they don't conflict with each other.
WalkWithSymlinks traverses a directory tree, following symbolic links and calling the provided function for each file or directory encountered.
WriteFileWithSamePermissions writes a file to the given destination with the given contents using the same permissions as the file at source.
WriterNotifier fires `notifyFn` once when the first data comes at `Writer(p []byte)` and forwards data further to the specified `writer`.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Should be good for 62^6 = 56+ billion combinations.
# Structs
No description provided by the author
FatalError is error interface for cases that should not be retried.
KeyLocks manages a map of locks, each associated with a string key.
No description provided by the author
MaxRetriesExceeded is an error that occurs when the maximum amount of retries is exceeded.
PathIsNotDirectory is returned when the given path is unexpectedly not a directory.
PathIsNotFile is returned when the given path is unexpectedly not a file.
ProcessExecutionError - error returned when a command fails, contains StdOut and StdErr.
TrapWriter intercepts any messages received from the `writer` output.