terragrunt.hcl
to your projectinclude
blockdependency
blockterragrunt-infrastructure-live-example
repository
.terragrunt-stack
directories to your repository .gitignore
fileterragrunt.stack.hcl
files_envcommon
directoryterragrunt.hcl
Launch the user interface for searching and managing your module catalog.
Example:
terragrunt catalog <repo-url> [--no-include-root] [--root-file-name] [--output-folder]
If <repo-url>
is provided, the repository will be cloned into a temporary directory, otherwise:
urls
listed in the catalog
configuration of your parent configuration file are used. If the root configuration file does not exist in the current directory, parent directories are recursively searched.For each of the provided repositories, Terragrunt will recursively search for OpenTofu/Terraform modules from the root of the repo and the modules
directory. A table with all the discovered OpenTofu/Terraform modules will subsequently be displayed.
You can then:
/
and start typing.ENTER
.terragrunt scaffold
to render a terragrunt.hcl
file that uses the module: S
.Terragrunt has a basic template built-in for rendering terragrunt.hcl
files, but you can provide your own templates to customize how code is generated! Scaffolding is done via an integration with boilerplate, and Terragrunt allows you to specify custom boilerplate templates via two mechanisms while using catalog:
.boilerplate
sub-directory of any OpenTofu/Terraform module.An example of how to define the optional default template, and the list of repositories for the catalog
command in a root.hcl
configuration file:
catalog {
default_template = "git@github.com/acme/example.git//path/to/template"
urls = [
"relative/path/to/repo", # will be converted to the absolute path, relative to the path of the configuration file.
"/absolute/path/to/repo",
"github.com/gruntwork-io/terraform-aws-lambda", # url to remote repository
"http://github.com/gruntwork-io/terraform-aws-lambda", # same as above
]
}
The following catalog
flags control behavior of the underlying scaffold
command when the S
key is pressed in a catalog entry:
--no-include-root
- Do not include the root configuration file in any generated terragrunt.hcl
during scaffolding.--root-file-name
- The name of the root configuration file to include in any generated terragrunt.hcl
during scaffolding. This value also controls the name of the root configuration file to search for when trying to determine Catalog urls.--output-folder
- Location for the scaffolded configurations. If flag is not provided current working directory is selected.