You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If `<repo-url>` is provided, the repository will be cloned into a temporary directory, otherwise:
25
25
26
-
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.
26
+
1. The repository list are searched in the [config file](#configuration)`terragrunt.hcl`. if `terragrunt.hcl` does not exist in the current directory, the config are searched in the parent directories.
27
27
1. If the repository list is not found in the configuration file, the modules are looked for in the current directory.
28
28
29
-
An example of how to define the list of repositories for the `catalog` command in the `terragrunt.hcl` configuration file:
29
+
The provided repositories will recursively be searched for OpenTofu/Terraform modules in the root of the repo and the `modules` directory. A table with all the discovered Terraform modules will subsequently be displayed. You can then:
30
+
31
+
1. Search and filter the table: `/` and start typing.
32
+
1. Select a module in the table: use the arrow keys to go up and down and next/previous page.
33
+
1. See the docs for a selected module: `ENTER`.
34
+
1. Use [`terragrunt scaffold`]({{site.baseurl}}/docs/features/scaffold/) to render a `terragrunt.hcl` for using the module: `S`.
35
+
36
+
### Custom templates for scaffolding
37
+
38
+
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 while using catalog:
39
+
40
+
1. You can define a custom boilerplate template in a `.boilerplate` subfolder of your Terraform module.
41
+
1. You can specify a custom boilerplate template in the [catalog config](#configuration).
42
+
43
+
### Configuration
44
+
45
+
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:
"relative/path/to/repo", # will be converted to the absolute path, relative to the path of the configuration file.
35
52
"/absolute/path/to/repo",
@@ -39,17 +56,10 @@ catalog {
39
56
}
40
57
```
41
58
42
-
This will recursively search for OpenTofu/Terraform modules in the root of the repo and the `modules` directory and show a table with all the modules. You can then:
43
-
44
-
1. Search and filter the table: `/` and start typing.
45
-
1. Select a module in the table: use the arrow keys to go up and down and next/previous page.
46
-
1. See the docs for a selected module: `ENTER`.
47
-
1. Use [`terragrunt scaffold`](https://terragrunt.gruntwork.io/docs/features/scaffold/) to render a `terragrunt.hcl` for using the module: `S`.
48
-
49
59
## Scaffolding Flags
50
60
51
61
The following `catalog` flags control behavior of the underlying `scaffold` command when the `S` key is pressed in a catalog entry:
52
62
53
63
-`--no-include-root` - Do not include the root configuration file in any generated `terragrunt.hcl` during scaffolding.
54
64
-`--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.
55
-
-`--output-folder` - Location for generated `terragrunt.hcl`. If flag is not provided current working directory is selected.
65
+
-`--output-folder` - Location for generated `terragrunt.hcl`. If flag is not provided current working directory is selected.
Copy file name to clipboardExpand all lines: docs/_docs/02_features/06-scaffold.md
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -68,10 +68,11 @@ Important notes:
68
68
69
69
## Custom templates for scaffolding
70
70
71
-
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:
71
+
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:
72
72
73
73
1. You can specify a custom boilerplate template to use as the second argument of the `scaffold` command.
74
-
1. You can define a custom boilerplate template in a `.boilerplate` subfolder of your module.
74
+
1. You can define a custom boilerplate template in a `.boilerplate` subfolder of your Terraform module.
75
+
1. You can define a default custom boilerplate template in the [catalog config]({{site.baseurl}}/docs/features/catalog/#configuration)
75
76
76
77
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.
77
78
There are also a set of variables that Terragrunt will automatically expose to your boilerplate templates for rendering:
0 commit comments