Skip to content

Commit 6421804

Browse files
authored
fix: Updating docs after #4035 (#4117)
* fix: Fixing markdownlint findings * feat: Adding content from #4035 to Starlight docs * fix: Removing invalid hash for link
1 parent 940d66b commit 6421804

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

docs-starlight/src/content/docs/02-features/05-catalog.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ If `<repo-url>` is provided, the repository will be cloned into a temporary dire
1919
1. The repository list are searched in the config file `terragrunt.hcl`. if `terragrunt.hcl` does not exist in the current directory, the config are searched in the parent directories.
2020
1. If the repository list is not found in the configuration file, the modules are looked for in the current directory.
2121

22-
An example of how to define the list of repositories for the `catalog` command in the `terragrunt.hcl` configuration file:
22+
An example of how to define the optional default template and the list of repositories for the `catalog` command in the `terragrunt.hcl` configuration file:
2323

2424
``` hcl
2525
# terragrunt.hcl
2626
catalog {
27+
default_template = "[email protected]/acme/example.git//path/to/template" # Optional default template to use for scaffolding
2728
urls = [
2829
"relative/path/to/repo", # will be converted to the absolute path, relative to the path of the configuration file.
2930
"/absolute/path/to/repo",
@@ -40,6 +41,13 @@ This will recursively search for OpenTofu/Terraform modules in the root of the r
4041
1. See the docs for a selected module: `ENTER`.
4142
1. Use [`terragrunt scaffold`](/docs/features/scaffold/) to render a `terragrunt.hcl` for using the module: `S`.
4243

44+
## Custom templates for scaffolding
45+
46+
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 [boilerplate](https://github.com/gruntwork-io/boilerplate), and Terragrunt allows you to specify custom boilerplate templates via two mechanisms while using catalog:
47+
48+
1. You can define a custom Boilerplate template in a `.boilerplate` sub-directory of any OpenTofu/Terraform module.
49+
2. You can specify a custom Boilerplate template in the catalog configuration using the `default_template` option.
50+
4351
## Scaffolding Flags
4452

4553
The following `catalog` flags control behavior of the underlying `scaffold` command when the `S` key is pressed in a catalog entry:

docs-starlight/src/content/docs/02-features/06-scaffold.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ Important notes:
6565

6666
## Custom templates for scaffolding
6767

68-
Terragrunt has a basic template built-in for rendering `terragrunt.hcl` files, but you can provide your own templates to customize what code is generated! Scaffolding is done via [boilerplate](https://github.com/gruntwork-io/boilerplate), and Terragrunt allows you to specify custom boilerplate templates via two mechanisms:
68+
Terragrunt has a basic template built-in for rendering `terragrunt.hcl` files, but you can provide your own templates to customize what code is generated! Scaffolding is done via [boilerplate](https://github.com/gruntwork-io/boilerplate), and Terragrunt allows you to specify custom boilerplate templates via three mechanisms - listed in order of priority:
6969

7070
1. You can specify a custom boilerplate template to use as the second argument of the `scaffold` command.
7171
2. You can define a custom boilerplate template in a `.boilerplate` subfolder of your module.
72+
3. You can define a default custom boilerplate template in the [catalog config](/docs/features/catalog).
7273

7374
If you define input variables in your boilerplate template, Terragrunt will prompt users for the values. Those values can also be passed in via `--var` and `--var-file` arguments.
7475
There are also a set of variables that Terragrunt will automatically expose to your boilerplate templates for rendering:

docs/_docs/02_features/05-catalog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ If `<repo-url>` is provided, the repository will be cloned into a temporary dire
2929
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.
3030

3131
You can then:
32+
3233
1. Search and filter the table: `/` and start typing.
3334
1. Select a module in the table: use the arrow keys to go up and down and next/previous page.
3435
1. See the docs for a selected module: `ENTER`.
@@ -63,4 +64,4 @@ The following `catalog` flags control behavior of the underlying `scaffold` comm
6364

6465
- `--no-include-root` - Do not include the root configuration file in any generated `terragrunt.hcl` during scaffolding.
6566
- `--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.
66-
- `--output-folder` - Location for the scaffolded configurations. If flag is not provided current working directory is selected.
67+
- `--output-folder` - Location for the scaffolded configurations. If flag is not provided current working directory is selected.

0 commit comments

Comments
 (0)