Units
A unit is configured in a terragrunt.hcl file in the unit’s directory, e.g.:
include "root" { path = find_in_parent_folders("root.hcl")}
dependencies { paths = ["../vpc", "../mysql", "../redis"]}Terragrunt also reads JSON-serialized HCL from terragrunt.hcl.json files. Wherever the docs mention terragrunt.hcl, a terragrunt.hcl.json file works too.
Terragrunt uses the first of these as a unit’s configuration file:
- The file the
--configflag names. - The file the
TG_CONFIGenvironment variable names. - A
terragrunt.hclfile in the current working directory. - A
terragrunt.hcl.jsonfile in the current working directory.
If none of them exists, Terragrunt exits with an error.
Blocks
Section titled “Blocks”| Name | Description |
|---|---|
catalog | Configures the module catalogs that the catalog and scaffold commands read. |
expansion | Generates one instance of a dependency, unit, or stack block per element of a collection. |
remote_ | Configures the OpenTofu/Terraform backend that stores a unit's state. |
terraform | Configures where Terragrunt gets the OpenTofu/Terraform module and how it runs tofu or terraform. |
The Blocks page documents the blocks not listed here.
Attributes
Section titled “Attributes”| Name | Description |
|---|---|
download_ | Overrides the directory Terragrunt downloads OpenTofu/Terraform modules into. |
iam_ | Sets the STS session duration, in seconds, for the IAM role Terragrunt assumes. |
iam_ | Sets the STS session name for the IAM role Terragrunt assumes. |
iam_ | Sets the IAM role Terragrunt assumes before invoking OpenTofu/Terraform. |
iam_ | Sets the web identity token, or the path to it, for assuming iam_role with AssumeRoleWithWebIdentity. |
inputs | Sets the input variables Terragrunt passes to OpenTofu/Terraform. |
prevent_ | Stops the destroy and run --all destroy commands from destroying a unit's resources. |
terraform_ | Overrides the OpenTofu/Terraform binary Terragrunt calls. |
terraform_ | Sets the OpenTofu/Terraform versions a unit accepts. |
terragrunt_ | Specifies which versions of the Terragrunt CLI can be used with your configuration. |
Functions
Section titled “Functions”| Name | Description |
|---|---|
get_ | Returns the value of an environment variable. |
The Functions page documents the functions not listed here.