Skip to content
👷 The Terragrunt website redesign is Work In Progress! 👷
For a list of outstanding TODOs see this.
To give feedback, click here.

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-root

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
Type: bool

Environment Variables:

  • TG_NO_INCLUDE_ROOT

--root-file-name

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
Type: string

Environment Variables:

  • TG_ROOT_FILE_NAME

--var

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"
Type: string

Environment Variables:

  • TG_VAR

--var-file

Variable file to use for the boilerplate template.

Specifies a file containing variables to be used in the boilerplate template during scaffolding. The file should contain variable definitions in HCL format.

Example:

Terminal window
# vars.hcl
environment = "prod"
region = "us-east-1"
# Command
terragrunt scaffold github.com/org/repo//modules/mysql --var-file=vars.hcl
Type: string

Environment Variables:

  • TG_VAR_FILE