Terragrunt configuration is defined in a terraform.tfvars file in a terragrunt = { ... } block.
For example:
terragrunt = {
include {
path = "${find_in_parent_folders()}"
}
dependencies {
paths = ["../vpc", "../mysql", "../redis"]
}
}
Terragrunt figures out the path to its config file according to the following rules:
- The value of the
--terragrunt-configcommand-line option, if specified. - The value of the
TERRAGRUNT_CONFIGenvironment variable, if defined. - A
terraform.tfvarsfile in the current working directory, if it exists. - If none of these are found, exit with an error.
The --terragrunt-config parameter is only used by Terragrunt and has no effect on which variable files are loaded
by Terraform. Terraform will automatically read variables from a file named terraform.tfvars, but if you want it
to read variables from some other .tfvars file, you must pass it in using the --var-file argument:
terragrunt plan --terragrunt-config example.tfvars --var-file example.tfvars