Skip to content

scaffold

Usage

Generate Terragrunt configuration files from a catalog.

Examples

Scaffold a standard MySQL database module as a new unit.

Terminal window
terragrunt scaffold github.com/gruntwork-io/terragrunt-infrastructure-modules-example//modules/mysql
Terminal window
terragrunt scaffold <MODULE_URL> [TEMPLATE_URL] [--var] [--var-file] [--no-include-root] [--root-file-name]

For more information on how scaffolding works, see the dedicated scaffold documentation.

Flags

--no-include-rootoptional(bool)

Disable inclusion of the root module in the generated `terragrunt.hcl` file (equivalent to using `--var=EnableRootInclude=false`, and will be overridden if the corresponding `var` value is set).

When enabled, Terragrunt will not automatically include the root configuration file in generated terragrunt.hcl files during scaffolding operations.

This is equivalent to setting --var=EnableRootInclude=false and will be overridden if that variable is explicitly set.

Example:

Terminal window
terragrunt scaffold github.com/org/repo//modules/mysql --no-include-root

Environment Variables:

  • TG_NO_INCLUDE_ROOT
--root-file-nameoptional(string)

Set the name of the root configuration file to include in the generated `terragrunt.hcl` file.

Specifies the name of the root configuration file to include in generated terragrunt.hcl files during scaffolding. This is equivalent to using --var=RootFileName=<name>, and will be overridden if the corresponding var value is set.

Example:

Terminal window
terragrunt scaffold github.com/org/repo//modules/mysql --root-file-name root.hcl

Environment Variables:

  • TG_ROOT_FILE_NAME
--varoptional(string)

Variable to use for the boilerplate template.

Sets variables to be used in the boilerplate template during scaffolding. You can specify multiple variables by using the flag multiple times.

Example:

Terminal window
terragrunt scaffold github.com/org/repo//modules/mysql \
--var="environment=prod" \
--var="region=us-east-1"

Environment Variables:

  • TG_VAR
--var-fileoptional(string)

Variable file to use for the boilerplate template.

Specifies a file containing variables to be used in the boilerplate template during scaffolding. The file is YAML, with one top-level key per variable.

Example:

vars.yml
environment: prod
region: us-east-1
Terminal window
terragrunt scaffold github.com/org/repo//modules/mysql --var-file=vars.yml

Environment Variables:

  • TG_VAR_FILE
--no-shelloptional(bool)

Disable shell commands when using boilerplate templates during scaffolding.

When enabled, Terragrunt will disable shell commands when processing boilerplate templates during scaffolding operations.

This is useful for security reasons when you want to prevent templates from executing arbitrary shell commands on your system.

Examples:

Terminal window
terragrunt scaffold github.com/org/repo//modules/mysql --no-shell

Environment Variables:

  • TG_NO_SHELL
--no-hooksoptional(bool)

Disable hooks when using boilerplate templates during scaffolding.

When enabled, Terragrunt will disable hooks when processing boilerplate templates during scaffolding operations.

This is useful for security reasons when you want to prevent templates from executing arbitrary hooks on your system.

Examples:

Terminal window
terragrunt scaffold github.com/org/repo//modules/mysql --no-hooks

Environment Variables:

  • TG_NO_HOOKS