NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Go modules, #380 by repository stars
Latest stable
v1.2.2
Last release today
23 Nov 2026
Ships on a steady schedule
a new release about every 8 days
Rarely documented
notes for 13 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
1862 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
WARN Setting the source of a unit or stack block with update_source_with_cas to a directory inside the stack directory is deprecated and will be remov…
run --all, and find or list with --dependencies, are faster in large repositories, including ones with no dependency blocks. The time spent linking units to their dependencies now grows linearly with the number of units instead of quadratically.
In benchmarks on an AMD Ryzen AI Max+ 395, discovering units and their dependencies in a generated repository of 10-unit dependency chains:
| units | before | after |
|---|---|---|
| 10 | 0.63ms | 0.63ms |
| 100 | 5.2ms | 5.0ms |
| 1,000 | 56ms | 47ms |
| 10,000 | 1.32s | 443ms |
At 10,000 units, memory allocated during discovery dropped from 8.6 GB to 1.9 GB.
Terragrunt wastes less time resolving symlinks in discovery. Dependent filters, such as --filter '...vpc' were able to reduce the number of wasted syscalls to resolve symlinks, improving dependent discovery.
On a repository of 1,024 units, discovery with a dependent filter took 30% less time from the repository root and 47% less time from the target unit's directory on an M3 Max. It also allocated 12-16% less memory.
Discovery prepared to read a terragrunt.stack.hcl in every directory named by a dependency or dependencies block, even when the directory was a unit. It now does that work only when the stack file exists.
In benchmarks on an AMD Ryzen AI Max+ 395, selecting the dependents of a unit that every other unit depends on, run from that unit's directory:
| units | before | after |
|---|---|---|
| 10 | 2.9ms | 2.3ms |
| 100 | 118ms | 86ms |
| 1,000 | 11.1s | 8.0s |
At 1,000 units, memory allocated during discovery dropped from 26.7 GiB to 10.3 GiB.
inputs-read-not-tracked — Points at files read in inputs that reading filters missTerragrunt does not track a file read in inputs. A unit with this configuration is not selected by --filter 'reading=config.yml' or by a Git filter when config.yml changes:
# terragrunt.hcl
inputs = {
message = yamldecode(file("config.yml")).message
}The same applies to inputs in an autoinclude block of a stack file.
Commands that track reads, such as run --all with a reading or Git filter and find --reading, now print the inputs-read-not-tracked tip pointing at each such read:
TIP (inputs-read-not-tracked): Terragrunt does not track files read in `inputs`, so reading and Git filters miss the units and stacks that read them.
Untracked file read in `inputs`
--> app/terragrunt.hcl:4:24
|
4 | message = yamldecode(file("config.yml")).message
| ^^^^^^^^^^^^^^^^^^ Read the file in `locals` and reference the local here.
Untracked file read in an `autoinclude` block's `inputs`
--> live/terragrunt.stack.hcl:16:29
|
16 | policy = templatefile("policy.json.tftpl", { role_arn = dependency.iam.outputs.role_arn })
| ^^^^^^^^^^^^^^^^^^^
|
= Mark the template as read with `mark_as_read` in the stack's `locals`, then pass the local as the path here.
See https://docs.terragrunt.com/features/filter/attributes#reading-based-expressions
See Reading-Based Expressions. Suppress the tip with --no-tip inputs-read-not-tracked or --no-tips.
cas-source-inside-stack strict controlA unit or stack block with update_source_with_cas could set a source inside the directory of its own stack file, e.g. a catalog with its stack at the root and its units under units/:
# catalog/terragrunt.stack.hcl
unit "foo" {
source = "./units/foo"
update_source_with_cas = true
path = "foo"
}Stack generation copies the stack directory whole. For a stack "bar" block with source = "../catalog", the generated stack contained the unit twice, and run --all ran both, the copy without the values its stack gives the generated unit:
.terragrunt-stack/bar/.terragrunt-stack/foo
.terragrunt-stack/bar/units/foo
Existing support will be retained for v1.x for backwards compatibility, to obey the Terragrunt 1.0 guarantees.
Terragrunt now warns about each such block:
WARN Setting the source of a `unit` or `stack` block with `update_source_with_cas` to a directory inside the stack directory is deprecated and will be removed in a future version of Terragrunt. Stack generation copies the stack directory whole, so `run --all` also runs the copy. Move the source out of the stack directory, and select the stack with a `//` subdirectory in its source.
WARN stack bar: unit "foo" in terragrunt.stack.hcl sets update_source_with_cas on source "./units/foo" inside the stack directory, so the generated stack also contains a copy of it; move the source out of the stack directory and select the stack with a // subdirectory in its source
With the new cas-source-inside-stack strict control enabled, each of those blocks is an error instead:
terragrunt stack generate --strict-control cas-source-inside-stackMove the stack into a subdirectory of the catalog, e.g. stacks/bar, keep its sources outside that subdirectory, and select it with source = "../catalog//stacks/bar". The cas-source-inside-stack control is also part of the deprecated-configs group.
no-dot-terragrunt-cache experiment adds a terraform.no_dot_terragrunt_cache attributeEnable the no-dot-terragrunt-cache experiment and set no_dot_terragrunt_cache = true in the terraform block of a unit without a source. Terragrunt then runs OpenTofu/Terraform in the unit directory instead of a copy in .terragrunt-cache, so local module paths resolve as written. The attribute is merged through include.
terraform {
no_dot_terragrunt_cache = true
}terragrunt run --experiment no-dot-terragrunt-cache -- planSetting it to true together with a source, or without the experiment enabled, returns an error.
variables-block experiment adds a variables blockEnable the variables-block experiment to set OpenTofu/Terraform variables with a variables block. Its kind attribute chooses how Terragrunt passes the inputs: TF_VAR_ environment variables (env, the default), a terragrunt.auto.tfvars file (tfvar), or a terragrunt.auto.tfvars.json file (json). Writing inputs to a file avoids the operating system's limit on the size of a process environment, which a unit with many or large inputs can exceed.
variables {
kind = "tfvar"
validate = true
inputs = {
vpc_id = dependency.vpc.outputs.vpc_id
}
}terragrunt run --experiment variables-block -- planWith the experiment enabled, terragrunt.auto.tfvars and terragrunt.auto.tfvars.json are reserved names in .terragrunt-cache. Terragrunt removes a file with either name from the cache when the unit has no inputs of that kind, so rename any such file in a unit, module, or generate block.
mcp-command — terragrunt mcp serves a catalog toolThe mcp command serves a new catalog tool. It returns the components terragrunt catalog returns, each in the shape terragrunt catalog --format=jsonl prints. Its component_source is the value a terraform block's source takes.
limit caps how many components come back, and include_docs adds each component's README. A repository that fails to load is listed in failures, and the components of the others still come back. Cloning a remote repository runs git, which needs --allow=exec. A local directory needs no capability.
mcp-command — --allow=docs relays the Terragrunt docs MCP serverAn agent connected to terragrunt mcp could not read the Terragrunt documentation unless the Terragrunt docs MCP server was configured as a second server. --allow=docs now relays that server's tools and resources through terragrunt mcp, each tool under a docs_ prefix, e.g. search_docs is served as docs_search_docs:
// .mcp.json
{
"mcpServers": {
"terragrunt": {
"command": "terragrunt",
"args": ["mcp", "--allow=docs"],
"env": {
"TG_EXPERIMENT": "mcp-command"
}
}
}
}Like every other capability, docs is denied unless granted, and granting http does not grant it. Every argument an agent passes to a docs_ tool leaves the machine, including any configuration it pastes in. If the docs server does not answer when the server starts, the server starts without the docs_ tools and logs a warning, and only a restart tries again.
See the mcp command docs for details.
mcp-command — A fmt tool formats HCL filesThe mcp server now serves a fmt tool, which rewrites the .hcl files under a directory into canonical format, as hcl fmt does. check reports the files that need formatting without changing any, diff adds a unified diff for each, file formats a single file, and filter narrows the set by path.
A server started with no --allow flag still lets an agent rewrite the .hcl files under its root. Symlinks are skipped, and a file outside the root is refused.
mcp-command — terragrunt mcp serves a scaffold toolThe mcp command serves a new scaffold tool. It writes new configuration from a module, unit, or stack source as terragrunt scaffold does, without prompting. values sets what to fill in. A required value left out is written as a TODO placeholder and listed in todo.
Files go in output_folder, which defaults to working_dir, must resolve under the server root, and must be empty or not exist yet. A failed call removes what it wrote. A remote source needs --allow=http, or --allow=exec for git. A local source needs no capability.
A template's shell helpers and hooks never run, even under --allow=exec. The tool refuses a template that declares dependencies or uses template syntax in a file or directory name, and a source with a symlink leading out of it.
otel-logs - More reliable log exportThe otel-logs experiment exports Terragrunt's logs as OpenTelemetry log records. This release makes the export more reliable:
run, now link to the root command span instead of carrying no trace ID.See OpenTelemetry for the settings and a Docker Compose example that sends traces to an OpenTelemetry collector and logs to Quickwit.
slow-task-reporting - One progress line on terminals, log lines in CISlow operations share one progress line, cut to the terminal width. Log lines print above it:
| Downloading source from git::https://github.com/acme/modules.git?ref=v1.2.0... (12s) +2 more
This fixes three problems: stale rows when a message was wider than the terminal, run --all output mixed into the progress text, and progress drawn over the terragrunt catalog TUI.
In CI, with TERM=dumb, and with json logs, Terragrunt writes INFO log lines instead of the progress line.
Operations are reported sooner, and more of them: unit discovery, dependency output fetches, provider caching, waits for new remote state resources, stack generate fetches, and lock waits.
The approval wait in terragrunt login, part of the tg-login experiment, uses the same progress line with or without slow-task-reporting.
A failed Git worktree creation no longer logs that it succeeded.
To learn more, see the experiment documentation.
v1.27.4The version of Golang used to compile the Terragrunt binary has been updated from v1.27.3 to v1.27.4.
None of the fixes in Go v1.27.4 change how Terragrunt behaves.
--all honors filters outside runThese commands accepted --filter with --all and then acted on every unit:
render --allinfo print --allaws-provider-patch --allbackend bootstrap --all and backend delete --all ignored the queries in a .terragrunt-filters or .terragrunt-excludes file, and render --all ignored --discovery-boundary.
All five now act only on the units the filters select, the way run --all does.
sshkey query parameterA git source with the sshkey query parameter failed under the Content Addressable Store (CAS), because CAS left the parameter on the address it passed to git.
CAS now removes sshkey from that address and connects with the key.
catalog keeps the clone directory inside its temporary directoryterragrunt catalog clones each repository into a directory named after the last segment of its URL, inside a fresh temporary directory. For a URL ending in /.., with or without a .git suffix, such as https://github.com/example/repo//.., that name was .., so the clone directory was the parent of the temporary directory. For a URL ending in /. it was the temporary directory itself. The run failed with:
refusing to remove clone path "/tmp" outside clone root "/tmp/catalog-<id>"
When the parent already held a .catalog-clone-complete file, the clone was skipped instead, and whatever the parent held was listed as the repository's components.
A name made only of dots now falls back to temp, so the clone directory always stays inside the temporary directory. Any other name is unchanged.
Terragrunt caches each parsed configuration file for the length of a command, and parses the file again when its modification time changes. A file rewritten soon after Terragrunt read it can keep the same modification time, as timestamps on Windows and on FAT volumes advance in coarse steps. Terragrunt then kept the cached result, and the rest of the command ran with the old contents.
Terragrunt now also compares the file's size, and compares the contents of any file modified shortly before it was read.
dependency blocks reject a null config_pathAn enabled dependency block whose config_path is null is now an error:
/path/to/terragrunt.hcl: dependency db sets config_path to null; set it to a path, or set enabled to false
Terragrunt used to drop these blocks without a warning. A reference to the block failed with This object does not have an attribute named "db", and setting an included block's config_path to null did not remove it: the unit still read the included block's outputs.
To turn a block off, set enabled = false. A disabled block can keep a null config_path, and its mock_outputs are still available to the unit:
dependency "db" {
config_path = local.use_db ? "../db" : null
enabled = local.use_db
mock_outputs = { id = "mock" }
}dependency block replaces it in the run --all queueA unit that overrode an included dependency block read its outputs from the new config_path, but run --all still ordered it after the included path. The unit waited for that unit and was skipped when it failed. find --dag listed both.
# root.hcl
dependency "db" {
config_path = "${get_terragrunt_dir()}/../db"
}
# app/terragrunt.hcl
include "root" {
path = find_in_parent_folders("root.hcl")
}
dependency "db" {
config_path = "../replica"
}app now depends only on replica. This also applies when a unit sets enabled = false on an included dependency block.
actions = [] in a unit's exclude block overrides an included block under run --allA unit that set actions = [] to turn off an included exclude block was still excluded from run --all, though terragrunt run plan in the same unit ran:
# root.hcl
exclude {
if = true
actions = ["plan"]
}
# app/terragrunt.hcl
include "root" {
path = find_in_parent_folders("root.hcl")
}
exclude {
if = true
actions = []
}run --all now uses the unit's exclude block, as terragrunt run does, so app runs.
exclude blocks with a null or missing if fail run --all before any unit runsAn exclude block whose if was null, or that left if out, excluded nothing from run --all. The unit itself then failed, but the dependencies its exclude_dependencies = true was meant to keep out of the run still ran:
# app/terragrunt.hcl
exclude {
if = local.skip # null
actions = ["all"]
exclude_dependencies = true
}run --all now fails while it builds the run queue, with the error a single unit run already gave:
Unsuitable value: null value is not allowed
Set if to true or false.
update_source_with_cas works in stacks sourced from OCI registries and HTTP archivesFor a unit or stack block sourced from an OCI registry, such as source = "oci://ghcr.io/acme/catalog//stacks/svc?tag=v1", or from an archive at an HTTP URL, Terragrunt copied only the selected directory of the package. Relative sources in that directory that set update_source_with_cas = true stayed as written, so generating the nested stack failed:
ERROR failed to fetch unit a
Source: ../..//units/a
Destination: .terragrunt-stack/svc/.terragrunt-stack/a
...
Original error: ... relative paths require a module with a pwd
The same catalog served from Git or a local path generated fine.
Stack generation now fetches the whole HTTP archive or OCI module package into the CAS and rewrites nested update_source_with_cas sources to cas:: references. An OCI package is keyed by its manifest digest, so a repeat generation with the same digest links the stored copy without a download.
A literal checksum= pin keys an HTTP archive the same way, and with the offline-cas experiment --cas-offline resolves it from the store; a checksum=file: reference is not answered offline.
As with other CAS-backed sources, the generated files are read-only unless the block sets mutable = true. --no-cas keeps the standard downloader, which copies only the selected directory.
The same checksum= keying applies to every CAS-backed HTTP source, not only stack generation: a terraform.source HTTP URL pinned with checksum= now goes through the CAS too, and a mismatch fails once instead of being downloaded a second time by the standard getter.
For every CAS-backed catalog, Git included, a nested update_source_with_cas source that cannot be rewritten now fails generation instead of falling back to a copy with the relative source left in place.
Under the offline-cas experiment, --cas-offline no longer fetches a source whose recorded probe came from a download that failed. For Git catalogs, the rewritten stack and unit files are now read-only by default like the rest of the tree, and mutable = true makes the copy writable.
With --provider-cache, users who shared a temp directory also shared its terragrunt folder. After one user created it, init could fail for the others:
mkdir /tmp/terragrunt/providers/archives-032480544: permission denied
On Unix, each user now gets a $TMPDIR/terragrunt-<uid> directory that only they can write to. If that directory is unsafe to use, Terragrunt logs a warning that says why and uses terragrunt/tmp in the user cache directory instead, such as ~/.cache/terragrunt/tmp on Linux.
root-terragrunt-hcl lookups and GIT_CEILING_DIRECTORIES--provider-cache resolves a relative download_url, shasums_url or shasums_signature_url against the registry response URL, as OpenTofu does.root-terragrunt-hcl strict control, find_in_parent_folders fails for ./terragrunt.hcl, ../terragrunt.hcl and other casings of that file, as it does with no argument. So does scaffold when its root file is terragrunt.hcl.GIT_CEILING_DIRECTORIES entry skip symlink resolution, as in git, even when the empty entry is not first.remote_state encryption works for units with existing unencrypted stateAdding encryption to a remote_state block for a unit that already had state failed in tofu init, and Terragrunt could not generate the fallback OpenTofu needs to read it:
Error: Error refreshing state
encountered unencrypted payload without unencrypted method configured
Set fallback = { method = "unencrypted" } in the encryption map for one terragrunt apply. OpenTofu reads the plaintext state and writes it back encrypted. Then remove fallback, and optionally set enforced = true so OpenTofu errors instead of writing unencrypted state or plan files.
remote_state {
backend = "s3"
config = {
bucket = "mybucket"
key = "path/to/my/key"
region = "us-east-1"
}
encryption = {
key_provider = "pbkdf2"
passphrase = get_env("PBKDF2_PASSPHRASE")
fallback = { method = "unencrypted" }
}
}See encryption for the generated OpenTofu configuration.
Some S3-compatible object stores answer GetBucketEncryption with HTTP 200 and an empty body instead of a ServerSideEncryptionConfigurationNotFoundError. Terragrunt then crashed with a nil pointer dereference while checking the bucket, which stopped every unit in the run.
Terragrunt now treats a bucket with no encryption document as unencrypted, the same as the not-found error. It lists Bucket Server-Side Encryption in the bucket update prompt, unless skip_bucket_ssencryption or disable_bucket_update is set. With --non-interactive, Terragrunt applies the update without asking.
When DescribeTable returns no table description during lock table setup, Terragrunt now fails the unit with an error that names the table and points at dynamodb_endpoint. Before, it crashed.
scaffold resolves relative paths against the working directoryterragrunt scaffold --output-folder live/vpc wrote into live/vpc under the directory the shell was in, not under --working-dir, and the same went for a relative --var-file. Both are now taken from the working directory, as the module URL already was. An absolute path is used as given.
The warning that the directory being scaffolded into is not empty now inspects the output folder, since that is where the files land.
A module named by a relative local path, such as ../modules/vpc, is downloaded relative to the working directory but was written into the generated terraform { source } as typed, where the unit reads it relative to its own directory. The two agreed only when --output-folder was unset. The generated source is now written relative to the output folder, so the unit points at the module that was scaffolded from. Absolute paths and remote URLs are written as before.
values are matched by reading filtersA stack that read a file in a unit or stack block, rather than in locals, was not recorded as reading it:
# live/app/terragrunt.stack.hcl
unit "app" {
source = "${get_repo_root()}/catalog/units/app"
path = "app"
values = {
message = yamldecode(file("${get_repo_root()}/shared/config.yml")).message
}
}--filter 'reading=shared/config.yml' did not match the stack, and a Git filter such as --filter '[main...HEAD]' did not regenerate it when only shared/config.yml changed, so its units never ran with the new value. Moving the same read into locals worked.
Terragrunt now tracks reads anywhere in a stack file, except inside autoinclude blocks. See Files read by stacks.
The span that wraps each Terragrunt command had a trailing space in its name and empty or unreadable attributes. A terragrunt run --all -- plan exported:
{
"name": "plan ",
"attributes": { "args": "&{ [] [] []}", "dir": "", "terraformCommand": "" }
}The span is now named plan, args is a list of the arguments passed to OpenTofu/Terraform, and dir is the working directory. Commands that don't run OpenTofu/Terraform, such as find, report only dir. The tofu_cli_args attribute of runner_pool_task and the args attribute of run_<binary> are lists too, on both spans and metrics, where before they were strings.
Three attributes have new names, so update any queries that filter on them:
terraformCommand is now tofu_command.terraform_command is now tofu_command.terraform_cli_args is now tofu_cli_args.The <command>_duration metric, such as plan_duration, now has one label, dir, set to the absolute working directory. Before, dir was empty unless you set --working-dir or TG_WORKING_DIR. Each working directory now gets its own metric series. The metric's args and terraformCommand labels are gone. They never held usable values, so remove them from any queries that filter on them.
Spans, metrics, and log records also report the Terragrunt version as their instrumentation scope version, which was empty.
See OpenTelemetry for how to export telemetry.
catalog tool to the mcp command by @yhakbar in #7234scaffold tool to the mcp command by @yhakbar in #7253docs capability to the mcp command by @yhakbar in #7256variables block by @yhakbar in #7238fmt tool to the mcp command by @yhakbar in #7239sshkey parameter while using CAS by @yhakbar in #7265if during discovery by @yhakbar in #7283--filter for render by @yhakbar in #7293rewrite implementation of the config package by @yhakbar in #7045starlight-llms-txt by @yhakbar in #7242terraform and remote_state HCL block docs to their own pages by @yhakbar in #7288v1.2.2 by @yhakbar in #7302no_dot_terragrunt_cache vs rewrite package by @yhakbar in #7232golines formatter usage in golangci-lint by @yhakbar in #7251v1.13.2 by @github-actions[bot] in #7259v1.17.1 by @github-actions[bot] in #7260venvtest.New with venv.MemVenv by @yhakbar in #7276pkg/venv package by @yhakbar in #7277v1.27.4 by @yhakbar in #7287Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Go bumped to v1.27.3 for a security fix
v1.27.3 for a security fixThe version of Golang used to compile the Terragrunt binary has been updated from v1.27.2 to v1.27.3.
Go v1.27.3 is a security release. It fixes CVE-2026-111943 in crypto/x509: certificate verification now rejects chains that contain a small set of untrusted intermediate certificates. Terragrunt uses this verification for every HTTPS connection it makes, including source downloads, provider registry lookups, and remote state backends. We recommend upgrading.
git, hg, and smbclient source downloads itselfTerragrunt downloaded git::, hg::, and smb:// sources through the getters built into the go-getter library, which started git, hg, and smbclient on their own. Terragrunt now implements these getters itself and starts those programs the same way it runs every other command.
Downloads should behave as they did before. If you find any functional difference, open an issue.
Because the downloads now go through Terragrunt's own command handling, Terragrunt's tests can cover them without a real git, hg, or smbclient install or a remote server, which makes regressions in source downloads easier to catch.
Repositories where every unit includes a root.hcl that loads shared files with read_terragrunt_config now parse much faster.
common.hcl that runs yamldecode(file(...)) on a large YAML file decoded it once per unit. Terragrunt now parses each file once and gives every unit the same result, and parses it again only when the file, or a file it reads, changes during the command. run --all parses it a second time when the run starts, after discovering units. A file whose result can differ between units, like one that calls get_original_terragrunt_dir() or has dependency blocks, is still parsed per unit.merge_strategy = "no_merge" that it would only have thrown away.In benchmarks on an Apple M3 Max, discovering units and their dependencies in a generated repository whose units read a 48 KB YAML file through read_terragrunt_config:
| units | before | after |
|---|---|---|
| 100 | 819ms | 59ms |
| 500 | 3.60s | 201ms |
| 1,000 | 7.01s | 379ms |
| 5,000 | 34.2s | 1.88s |
Memory allocated during discovery dropped by about 95%.
Terragrunt now analyzes --filter expressions before discovery starts and uses them to narrow the filesystem walk it does during discovery. Filters that name specific paths let Terragrunt skip most of the walk, or walk only the directories those paths can match.
On a repository of 10,000 units, discovery with a filter like --filter './doublestar/glob/**', matching 1,250 of those units, took 27 ms instead of 224 ms. A filter like --filter './path/to/specific/unit', which names a single unit, took under 1 ms instead of 215 ms. Discovery selects the same units as before. It still walks the whole working directory when there is no filter, when every filter is negated, or when any filter can select a unit anywhere, such as name=vpc or ...vpc.
run_cmd result run the command onceUnits share a run_cmd result when the call uses --terragrunt-global-cache, or when it is in a file they read with read_terragrunt_config. Discovery parses units concurrently, so several of them could start the command before any had cached its result, and run --all could run a shared command once per unit.
Units now wait for the first run and reuse its result. If that run fails, the next unit runs the command itself.
The Overview now has Azure and GCP examples for every step. The Azure examples create a resource group and a virtual network in eastus and westus2, with state in an azurerm backend. The GCP examples create a VPC network and a Cloud Router in us-central1 and us-east1, with state in a gcs backend.
The code for each step is in test/fixtures/docs/02-overview-azure and test/fixtures/docs/02-overview-gcp. Integration tests apply and destroy each step in both directories.
These pages also have Azure and GCP examples now:
env.hcl that generates the provider for every unit in an environment.root.hcl that configures the backend and generates the provider.backend bootstrap, backend migrate, and backend delete show what each command creates, moves, or deletes for an azurerm or gcs backend.azurerm or gcs backend once in root.hcl.Authentication now has a page for each cloud provider. The Azure page covers signing in with the Azure CLI, a service principal, OIDC, or a managed identity. The GCP page covers gcloud, a service account key, Workload Identity Federation, and an attached service account. Each lists the roles its state backend needs. The AWS content moved to the AWS page, and links to its old headings redirect there.
State Backend also has a page for each backend now: S3, GCS, and Azure Storage. Links to the old backend headings redirect to the new pages. The GCS page now covers what the Azure section already did: the order Terragrunt resolves credentials in, the settings Terragrunt reads without passing them to OpenTofu/Terraform, and the backend's known limitations.
Pick a cloud provider in any example tab, and every tab on the page switches with it. Other pages open on the same provider when they have a tab for it, and show AWS when they don't.
In run --all, a unit could run at the same time as another unit reading its outputs, e.g. with --queue-ignore-dag-order, or when a Git filter plans the destroy of a removed unit while its dependents plan. Both ran OpenTofu/Terraform in the unit's .terragrunt-cache directory, so one could reinstall providers while the other used them, and the run failed with errors such as:
Error: Required plugins are not installed
- registry.opentofu.org/hashicorp/null: the cached package for registry.opentofu.org/hashicorp/null 3.2.4 (in .terraform/providers) does not match any of the checksums recorded in the dependency lock file
Terragrunt now waits for a unit's run to finish before reading its outputs, and waits for a read in progress before running the unit.
-detailed-exitcode no longer hides failures without an exit codeWith -detailed-exitcode, e.g. terragrunt run --all -- plan -detailed-exitcode, a failure that came with no exit code from OpenTofu/Terraform, such as the binary failing to start, was recorded as exit code 0. Terragrunt dropped the error and reported the unit as successful.
Terragrunt now records exit code 1 for these failures and returns the error.
exclude blocks that reference dependency outputs fail with a clear errorAn exclude block whose attributes referenced a dependency output, such as if = dependency.vpc.outputs.skip, never worked with run --all. Terragrunt evaluates the block while it builds the run queue, before any dependency has run, so it ignored the block with a warning and ran the unit anyway. Single unit runs read the output, so the same config behaved differently depending on the command.
Terragrunt now rejects the config on every command:
exclude block in /live/app/terragrunt.hcl cannot reference dependency outputs; exclude blocks are evaluated before dependencies run
Base the exclusion on a feature flag or a local instead.
hcl validate errors point at the code that caused themterragrunt hcl validate printed each error in a box, with the absolute path of the file and the whole source line:
╷
│ Error: Unsupported argument
│
│ on /path/to/live/app/terragrunt.hcl line 1:
│ 1: foo = 1
│
│ An argument named "foo" is not expected here.
╵
It now prints the path relative to the working directory, with the line and column, and underlines the part of the line the error is about:
error: Unsupported argument
--> app/terragrunt.hcl:1:1
|
1 | foo = 1
| ^^^ An argument named "foo" is not expected here.
A dependency block whose config_path names a directory that does not exist is reported the same way, pointing at the config_path:
error: Missing dependency
--> app/terragrunt.hcl:2:17
|
2 | config_path = "../nonexistent"
| ^^^^^^^^^^^^^^^^ This directory does not exist.
Scripts that read hcl validate output should use --json, whose fields have not changed.
--out-dir keeps a plan for each Git reference that selects a unitrun --all with --out-dir or --json-out-dir mirrors each unit under the output directory. Two Git filters that selected the same unit at different references, e.g. --filter '[HEAD~2...HEAD~1]' --filter '[HEAD~1...HEAD]', mirrored both to the same path. Each run overwrote the other's plan file, so the plan saved for one reference held the other's changes.
A unit that a Git filter selects at a reference now goes under a directory named for the reference, with @ in front and characters other than letters, digits, -, and _ replaced by _:
<out-dir>/@HEAD_1/env/app/tfplan.tfplan
<out-dir>/@HEAD/env/app/tfplan.tfplan
A unit found by walking the working directory keeps its path, and planning and applying with the same --filter still find the same files.
read_terragrunt_config no longer leaks the reading unit's locals into the file it readsA file read with read_terragrunt_config evaluated its include and feature blocks with the reading unit's local and feature values still in scope, so a feature block in the file could reference a local the file never defined, and parse or fail depending on which unit read it. The file now evaluates those blocks with only its own values in scope, as it always did for the rest of its contents.
A file that referenced the reader's values this way fails with:
Unsupported attribute; This object does not have an attribute named "region".
Define the value in the file being read, or move it to the unit and reference it there. To build a path from the reading unit's directory, call get_original_terragrunt_dir() in the file.
run_cmd results are cached per environment and exact argumentsA run_cmd call in a file shared via read_terragrunt_config returned the first unit's output to every unit, even when --auth-provider-cmd gave each unit different credentials. run_cmd("printf", "%s|", "x y") and run_cmd("printf", "%s|", "x", "y") also shared one cached result.
Terragrunt now caches each result per environment and exact arguments, so every unit gets the output its own credentials produce.
use_path_style applies to Terragrunt's own S3 requestsOpenTofu deprecates the s3 backend's force_path_style setting in favor of use_path_style, but Terragrunt only read force_path_style. With use_path_style = true in remote_state, OpenTofu used path-style URLs while Terragrunt's backend bootstrap and dependency output reads did not. Against an S3-compatible object store, bootstrap then failed with errors such as:
operation error S3: HeadBucket, https response error StatusCode: 501, RequestID: , HostID: , api error NotImplemented: Not Implemented
Terragrunt now reads use_path_style as well as force_path_style. See S3-compatible object stores for a working configuration.
iac-engine — Terragrunt and engines authenticate each other with mutual TLSTerragrunt now starts each engine with a one-time client certificate in PLUGIN_CLIENT_CERT, and the engine replies with a one-time certificate of its own. The connection is encrypted, and each side accepts only the other's certificate. Engines built on the hashicorp/go-plugin server, including terragrunt-engine-opentofu, need no changes. An engine that implements the handshake itself must support this, or its runs fail with:
rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: tls: first record does not look like a TLS handshake"
dependency-config-path-file strict controlA dependency block could set config_path to a configuration file instead of the directory of a unit or stack:
dependency "db" {
config_path = "../db/terragrunt.hcl"
}This was never documented, and Terragrunt supported it inconsistently. Existing support will be retained for v1.x for backwards compatibility, to obey the Terragrunt 1.0 guarantees.
Setting config_path to a file is now deprecated. Terragrunt warns when it finds one, then names each block once:
WARN Setting the `config_path` of a `dependency` block to a file is deprecated and will be removed in a future version of Terragrunt. Set it to the directory of the unit or stack instead.
WARN /path/to/terragrunt.hcl: dependency db sets config_path to the file ../db/terragrunt.hcl; set it to the directory of the unit or stack
With the new dependency-config-path-file strict control enabled, each of those blocks is an error instead:
terragrunt run plan --strict-control dependency-config-path-file/path/to/terragrunt.hcl: dependency db sets config_path to the file ../db/terragrunt.hcl; set it to the directory of the unit or stack
Set config_path to the directory of the configuration, e.g. ../db. The dependency-config-path-file control is also part of the deprecated-configs group.
hcl validate by @yhakbar in #7122symlink experiment by @yhakbar in #7178--out-dir by @yhakbar in #7158use_path_style by @yhakbar in #7192v1.2.1 stuff by @yhakbar in #7198find --json performance by @yhakbar in #7055v1.2.1 by @yhakbar in #7185v1.27.3 by @yhakbar in #7176Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This change does not break those promises. It is listed under breaking changes so you are aware of it, in case it affects your workflows.
This is a big minor release, and it introduces significant new capabilities in Terragrunt.
For a brief overview of the changes in this release, read the blog post.
This release completes the following experiments:
block-iterationocibounded-discoverycatalog-formatmutable-generateoptional-dependency-outputsoptional-hooksazure-backendversion-attributeprofilingdependency-fetch-output-from-statebase64gzip() now uses the Go 1.27 gzip encoderGo 1.27 changed the compressed output of its gzip encoder. Terragrunt v1.1.5 kept base64gzip() on the older output and warned once per run that this was legacy behavior. base64gzip() now returns what the Go 1.27 encoder produces.
A resource that compares the encoded value can plan a replacement on the first run after upgrading. An aws_instance with user_data_base64 set from base64gzip() and user_data_replace_on_change set to true is one such resource.
Where the encoded value has to stay stable, call the experimental base64gzip_compat(), which returns the v1.1.3 output permanently. It is behind the base64gzip-compat experiment and may be renamed or removed:
terragrunt run --all --experiment base64gzip-compat -- planinputs = {
user_data_base64 = base64gzip_compat(file("${get_terragrunt_dir()}/user-data.sh"))
}This completes the legacy-base64gzip strict control.
Note
Within the 1.0 guarantees
The 1.0 guarantees make promises about how Terragrunt remains backwards compatible. This change does not break those promises. It is listed under breaking changes so you are aware of it, in case it affects your workflows.
base64gzip() still takes a string and returns valid gzipped base64 content that decompresses to the same value, but the encoded value itself changes. base64gzip_compat() keeps the old one.
When bootstrapping an S3 state bucket, Terragrunt attached a bucket policy statement with the Sid RootAccess that granted s3:* on the bucket and its objects to arn:aws:iam::<account-id>:root, an ARN that grants access to the AWS account as a whole rather than only to its root user. That statement has been removed. It widened reach to state files that routinely hold secrets, and the account already owns the bucket.
The skip_bucket_root_access config no longer has anything to skip, and is now deprecated. Terragrunt still accepts it, and warns about it when bootstrapping a backend whose config sets it. Enable the skip-bucket-root-access strict control to turn that warning into an error.
To grant the AWS account root user access to the state bucket, set the new enable_bucket_root_access config:
# root.hcl
remote_state {
# ... other args omitted for brevity ...
config = {
# ... other config omitted for brevity ...
enable_bucket_root_access = true
}
}Buckets that already have the statement keep it. The state backend docs cover how to remove it yourself.
Note
Within the 1.0 guarantees
The 1.0 guarantees make promises about how Terragrunt remains backwards compatible. This change does not break those promises. It is listed under breaking changes so you are aware of it, in case it affects your workflows.
The bucket policy Terragrunt writes is not part of the CLI, HCL, or output schemas the guarantees pin, and skip_bucket_root_access remains valid configuration. Removing the statement is a bug fix, and enable_bucket_root_access restores it. See Bugs in the guarantees for how a bug fix in 1.x can change your workflows.
terragrunt catalog output with --formatThe catalog TUI needs a terminal. The --format flag (env: TG_FORMAT) writes what the catalog discovers to standard output, so a script or an agent can read the catalog without one.
--format=jsonl writes one JSON object per catalog entry, following a published JSON schema:
terragrunt catalog --format=jsonl | jq -c '{kind, title, component_source}'--format=md writes a Markdown document with a section per entry:
terragrunt catalog --format=md > catalog.mdWithout --format, terragrunt catalog opens the TUI only when standard input and standard output are both terminals. Anywhere else it writes jsonl, so piping the command needs no flag:
terragrunt catalog | jq -c '{kind, title, component_source}'Terragrunt writes each entry as it discovers it. See Non-interactive catalog for the structure of each format and how streaming behaves.
Previously gated behind the catalog-format experiment, non-interactive catalog output no longer requires --experiment catalog-format.
Terragrunt writes CPU, heap, and goroutine profiles on request, so you can see where a slow run spends its time. Pass --profile-cpu, --profile-mem or --profile-goroutine with a path, or --profile-dir to collect all three into one directory under conventional names. Each flag has a matching TG_PROFILE_* environment variable.
terragrunt --profile-dir /tmp/profiles run --all -- planRead the result with go tool pprof. The profiles cover Terragrunt itself, not the OpenTofu/Terraform processes it runs.
Previously gated behind the profiling experiment, the profile flags no longer require --experiment profiling.
--discovery-boundary and (dir) filtersGraph filters search up to the Git repository root for dependents and follow dependencies wherever they point, so in a monorepo they can parse sibling environments a command never needed.
A (dir) operand in a graph filter stops traversal at that directory:
cd environments/staging
terragrunt find --filter '(.)...vpc'From the same directory, the --discovery-boundary flag (env: TG_DISCOVERY_BOUNDARY) applies one boundary to every --filter expression on the command:
terragrunt run --all --filter '...vpc' --discovery-boundary . -- planPreviously gated behind the bounded-discovery experiment, bounded discovery no longer requires --experiment bounded-discovery.
Terragrunt now publishes the read-only Terragrunt docs MCP server, which answers Terragrunt questions from the official docs, the CLI reference, a curated design-pattern library, and real example config. The server is public and unauthenticated. Results are pinned to a Terragrunt version, and docs pages can be read at any release tag from v0.80 onward.
For Claude Code:
claude mcp add -s user --transport http terragrunt-docs https://mcp.docs.terragrunt.com/mcpCursor and other MCP clients that read an mcp.json point at https://mcp.docs.terragrunt.com/mcp instead.
The server is in public beta. It has no availability guarantee and may change significantly.
See the install docs for the full setup.
An oci:// source downloads a module from an OCI Distribution registry, such as Amazon ECR, GitHub Container Registry, Azure Container Registry, Google Artifact Registry, or a self-hosted one. It works in a terraform block:
# terragrunt.hcl
terraform {
source = "oci://ghcr.io/acme/tofu-modules/vpc?tag=1.0.0"
}And in the unit and stack blocks of a terragrunt.stack.hcl:
# terragrunt.stack.hcl
unit "vpc" {
source = "oci://ghcr.io/acme/terragrunt-units/vpc?tag=1.0.0"
path = "vpc"
}Pin the artifact with tag or digest. Setting neither selects the latest tag, and a //subdir selector reaches a directory inside the module, unit, or stack. Credentials come from OpenTofu's CLI config, from ambient Docker config, and from credential helpers such as ecr-login, so one source string resolves the same way under both tofu and Terragrunt.
Previously gated behind the oci experiment, these sources no longer require --experiment oci. See OCI registries for the publishing contract and the full authentication order.
Terragrunt records the files that the built-in file functions read, so reading-based filters select the units that read them without a mark_as_read call:
filetemplatefilefilesetfileexistsfile* hash functions, such as filesha256A file read from inside a template counts too.
mark_as_read remains the way to record a file that only OpenTofu/Terraform reads, such as one passed to a module as an input, or one a run_cmd script reads.
The Content Addressable Store (CAS) now stores the files that generate blocks produce. Each unit's working directory gets a hard link to the stored copy, so every unit that includes this block shares one provider.tf on disk:
# root.hcl
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = "provider \"aws\" {}"
}Generated files are read-only by default, so an existing hook or script that edits a generated file in place fails with a permission error. Set mutable = true on that generate block to give each unit a writable file of its own:
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
mutable = true
contents = "provider \"aws\" {}"
}Passing --no-cas turns off the CAS for a run, and Terragrunt writes generated files as plain files:
terragrunt run --all --no-cas -- planSee Generate blocks and Immutable by default for details.
Previously gated behind the mutable-generate experiment, CAS storage for generated files no longer requires --experiment mutable-generate.
unit, stack, and dependency blocks with expansionAn expansion block adds a count or a for_each to the unit, stack or dependency that contains it, and Terragrunt generates a copy of the block per element.
This unit block generates two units, at .terragrunt-stack/aurora/web and .terragrunt-stack/aurora/api:
# terragrunt.stack.hcl
unit "aurora" {
expansion {
for_each = toset(["web", "api"])
}
source = "../units/app"
path = "aurora/${each.key}"
values = {
role = each.key
}
}A stack block expands the same way, generating one stack per element.
An expanded dependency block produces one dependency per element, and inputs reads each one by its key:
# terragrunt.hcl
dependency "aurora" {
expansion {
for_each = toset(["web", "api"])
}
config_path = "../aurora-${each.key}"
}
inputs = {
web_id = dependency.aurora["web"].outputs.id
}unit and stack blocks also accept an enabled attribute. Setting it to false skips the component during stack generation:
# terragrunt.stack.hcl
unit "canary" {
enabled = false
source = "../units/app"
path = "canary"
}Adding an expansion block to an existing block, or shrinking one, changes the addresses of the components it produces. Read the expansion reference before changing one that has already been applied.
Previously gated behind the block-iteration experiment, expansion blocks and the enabled attribute no longer require --experiment block-iteration.
Terragrunt provisions the resource group, storage account, and blob container backing an azurerm state, and converges blob versioning and soft delete on both new and pre-existing accounts. It also deletes state blobs and containers, and migrates state within a storage account. Dependency outputs of Azure-backed units are read straight from the state blob, the same as S3 and GCS.
If you already pass --backend-bootstrap, Terragrunt now creates Azure resources it skipped before.
Previously gated behind the azure-backend experiment, these operations no longer require --experiment azure-backend. See State Backend for configuration keys and authentication.
The ARM API treats an unset minimum TLS version as TLS1_0, but Azure deprecated TLS1_0 and TLS1_1 in August 2025.
Terragrunt now provisions a new storage account with a minimum TLS version of TLS1_2. The minimum_tls_version option raises it to TLS1_3:
remote_state {
backend = "azurerm"
config = {
storage_account_name = "myterragruntstate"
container_name = "tfstate"
key = "${path_relative_to_include()}/tofu.tfstate"
resource_group_name = "tofu-rg"
use_azuread_auth = true
minimum_tls_version = "TLS1_3"
}
}TLS1_2 and TLS1_3 are the only accepted values. Terragrunt rejects the deprecated TLS1_0 and TLS1_1.
The setting applies only when Terragrunt creates the account. Terragrunt leaves an existing account's setting alone, so change it there with the Azure portal or CLI.
Terragrunt evaluates the built-in functions in configurations using its own copy of the OpenTofu implementations, which tracks OpenTofu 1.13.
These functions are now available:
assumeequalassumelistlengthassumelistlengthmaxassumelistlengthminassumemaplengthassumemaplengthmaxassumemaplengthminassumenotnullassumesetlengthassumesetlengthmaxassumesetlengthminassumestringprefixbase64gunzipcidrcontainsephemeralasnullissensitivetemplatestringurldecodeTerragrunt reads dependency outputs straight from the remote state object, without initializing each dependency to run tofu output or terraform output against it. This covers the S3, GCS, and Azure Storage (azurerm) backends.
When a direct read is unsupported, such as for a backend Terragrunt has no reader for, or fails on a permissions or network error, Terragrunt falls back to tofu/terraform output -json. The outputs are the same either way, so only the speedup is lost.
Pass --no-dependency-fetch-output-from-state (env: TG_NO_DEPENDENCY_FETCH_OUTPUT_FROM_STATE) to always load dependency outputs through tofu/terraform output -json.
Previously gated behind the dependency-fetch-output-from-state experiment, direct state reads no longer require --experiment dependency-fetch-output-from-state. Passing --dependency-fetch-output-from-state still works, and the dependency-fetch-output-from-state strict control turns its deprecation warning into an error.
The terraform block accepts a version attribute holding a version constraint for a tfr:// registry module. Terragrunt downloads the highest published version that satisfies the constraint, using the same syntax as the version argument on OpenTofu and Terraform module blocks:
terraform {
source = "tfr://registry.opentofu.org/terraform-aws-modules/vpc/aws"
version = "~> 3.3"
}See the terraform block reference for the full rules.
Previously gated behind the version-attribute experiment, version constraints for registry modules no longer require --experiment version-attribute.
An account regional namespace is a reserved subdivision of the S3 bucket namespace that only your account can create buckets in, so no one else can take or re-create those names. Bucket names in it end with your account ID, the region, and -an.
When a bucket name matches that convention, Terragrunt creates the bucket in the account regional namespace:
# root.hcl
remote_state {
backend = "s3"
config = {
bucket = "my-tofu-state-111122223333-us-east-1-an"
key = "${path_relative_to_include()}/tofu.tfstate"
region = "us-east-1"
}
}There is no setting to enable this. S3 only accepts the -an suffix for account regional buckets, so naming the bucket like that automatically makes it an account regional namespace bucket. accesslogging_bucket_name is read the same way. Buckets named any other way are created in the global namespace, and the namespace is left out of the request entirely, so S3-compatible object stores are unaffected.
A name that fits the convention but names a region other than the bucket's own fails immediately.
--no-dependency-outputsThe --no-dependency-outputs flag (env: TG_NO_DEPENDENCY_OUTPUTS) skips output resolution for every dependency block in a run, so Terragrunt does not call tofu output on dependencies that may not be applied yet:
terragrunt run --all --no-dependency-outputs -- validateWarning
Use this flag with commands that do not read dependency outputs, such as init and validate. While it is set, references to dependency outputs get no real value, so plan and apply can pass empty values to OpenTofu/Terraform in their place.
Previously gated behind the optional-dependency-outputs experiment, the flag no longer requires --experiment optional-dependency-outputs.
--no-hooksThe --no-hooks flag (env: TG_NO_HOOKS) skips every hook for a run: before_hook, after_hook, and error_hook blocks.
terragrunt run --no-hooks -- planPreviously gated behind the optional-hooks experiment, --no-hooks no longer requires --experiment optional-hooks.
S3 disables ACLs on new buckets by default, and a bucket with ACLs disabled rejects the ACL grant Terragrunt wrote to make an access logging bucket accept logs. AWS recommends a bucket policy over an ACL for this grant, and recommends keeping ACLs disabled in general.
Terragrunt now creates buckets with ACLs disabled and grants access log delivery through the logging bucket's policy instead, allowing s3:PutObject for the logging.s3.amazonaws.com service principal on behalf of buckets in the same AWS account:
remote_state {
backend = "s3"
config = {
bucket = "my-state-bucket"
key = "${path_relative_to_include()}/tofu.tfstate"
region = "us-east-1"
accesslogging_bucket_name = "my-logs-bucket"
}
}This only applies to a logging bucket Terragrunt creates. One that already exists keeps the permissions it has, whether that is the ACL grant from an earlier Terragrunt version or something you set up yourself, and Terragrunt neither reads nor writes its policy.
skip_accesslogging_bucket_policy opts out of that grant. skip_accesslogging_bucket_acl is deprecated and now has no effect: Terragrunt puts no ACL on the logging bucket, so there is nothing left for it to skip.
If you set skip_accesslogging_bucket_acl to work around an AccessControlListNotSupported failure on a bucket with ACLs disabled, drop it. The bucket policy covers that bucket, and the attribute now suppresses nothing. Set skip_accesslogging_bucket_policy only if you grant log delivery yourself. Terragrunt warns when the deprecated attribute is used, and the skip-accesslogging-bucket-acl strict control turns that warning into an error.
assign_blob_data_role sends the principal type of the authenticated identityWhen principal_id was unset, Terragrunt resolved the authenticated identity from its access token but sent the role assignment without a principalType. An identity whose roleAssignments/write permission is constrained by a condition on the principal type, such as a delegated Role Based Access Control Administrator limited to service principals and groups, was then denied the Storage Blob Data Contributor grant.
Terragrunt now sends the principal type it reads from the token. When the token does not state the type, and for an explicitly configured principal_id, the assignment is still sent without a type, so Azure infers it.
include blocks warn againTerragrunt stopped logging the deprecation warning for an include block without a label, so a configuration using one gave no hint that the bare-include strict control would reject it. The parser setup suppressed the warning on the shared control before any file was read, and the check that finds the bare include then had nothing left to log.
A run over a configuration with a bare include now logs the warning once:
WARN Using an `include` block without a label is deprecated. Please use the `include` block with a label instead. For more information, see https://docs.terragrunt.com/migrate/bare-include/
With --strict-mode or --strict-control bare-include, the run still fails with an error and logs no warning. See the bare include migration guide for how to label the block.
expansion works with autoinclude and stack dependenciesterragrunt stack generate failed with There is no variable named "each" when a unit or stack block declared both an expansion block and an autoinclude block. The error pointed at each.key in path, even when autoinclude never referenced each.
Generation now writes an autoinclude file for each element, and each.key, each.value, and count.index inside autoinclude resolve to that element:
# terragrunt.stack.hcl
unit "repo" {
source = "../units/repo"
path = "repo"
}
unit "environment" {
expansion {
for_each = toset(["dev", "prod"])
}
source = "../units/environment"
path = "environment/${each.key}"
autoinclude {
dependency "repo" {
config_path = unit.repo.path
}
inputs = {
environment = each.key
repository = dependency.repo.outputs.name
}
}
}The prod element gets this terragrunt.autoinclude.hcl:
dependency "repo" {
config_path = "../../repo"
}
inputs = {
environment = "prod"
repository = dependency.repo.outputs.name
}A dependency block inside autoinclude that declared its own expansion block failed generation with the same error. A unit whose terragrunt.autoinclude.hcl contained one also failed to parse. An expanded unit could not be referenced from the stack file at all, since unit.<name>.path skipped it.
Each element of an expanded unit or stack is now referenced as unit.<name>[key].path. The generated dependency block keeps its expansion block. Generation evaluates for_each or count in the stack file, where local.* and values.* are available, writes the result as a literal, and resolves config_path for each element. The generated unit expands the dependency when it is parsed:
# terragrunt.stack.hcl
locals {
regions = toset(["us-east-1", "us-west-1"])
}
unit "vpc" {
expansion {
for_each = local.regions
}
source = "../units/vpc"
path = "vpc/${each.key}"
values = {
region = each.key
}
}
unit "app" {
source = "../units/app"
path = "app"
autoinclude {
dependency "vpc" {
expansion {
for_each = local.regions
}
config_path = unit.vpc[each.key].path
mock_outputs = { vpc_id = "vpc-mock-${each.key}" }
}
inputs = {
vpc_ids = { for region, vpc in dependency.vpc : region => vpc.outputs.vpc_id }
}
}
}# .terragrunt-stack/app/terragrunt.autoinclude.hcl
dependency "vpc" {
expansion {
for_each = toset(["us-east-1", "us-west-1"])
}
config_path = {
us-east-1 = "../vpc/us-east-1"
us-west-1 = "../vpc/us-west-1"
}[each.key]
mock_outputs = { vpc_id = "vpc-mock-${each.key}" }
}
inputs = {
vpc_ids = { for region, vpc in dependency.vpc : region => vpc.outputs.vpc_id }
}A stack file that declares the same unit or stack label both with and without an expansion now fails to parse, because unit.<name> cannot refer to both.
Discovery failed the same way on a dependency whose config_path pointed at a stack directory containing an expanded unit. It dropped the dependency instead of reporting the error, so run --all did not wait for the units in that stack. The dependency now covers every element of the expanded unit.
After a fetch that brings in more than about a hundred commits, git starts git maintenance run --auto in the background and returns without waiting for it. That process kept writing commit graphs into the CAS git store for a few seconds after Terragrunt had moved on, outside the lock Terragrunt holds on that store entry, and into temporary clones Terragrunt was already deleting.
Every git fetch Terragrunt runs now turns automatic maintenance off, so the fetch is finished when it returns.
.terragrunt-stack out of local sourcesA stack reading a local source from its own repository, such as source = "../..//catalog/stacks/foo" with update_source_with_cas = true, got a new CAS key on every stack generate, even when the source had not changed.
CAS now leaves .terragrunt-stack out of local sources, like it does for .terraform and .terragrunt-cache.
update_source_with_cas works on components injected by a stack-level autoincludeCAS ignored update_source_with_cas = true on a unit or stack block injected by a stack-level autoinclude in a catalog stack, so its relative source reached the nested stack unchanged and generation failed with relative paths require a module with a pwd. CAS now rewrites these blocks too.
A source pinned to a tag, such as ?ref=v1.2.3, failed to clone through the CAS when the repository also had a branch whose name ends in the tag name, such as release/v1.2.3, and that branch had moved past the tag:
WARN central git store unavailable for https://github.com/acme/modules.git, falling back to temporary clone: object <release/v1.2.3 commit> not present in central git store after fetching v1.2.3 from https://github.com/acme/modules.git
WARN CAS processing failed for unit "service": failed to CAS clone "https://github.com/acme/modules.git": ... fatal: not a tree object
Terragrunt then downloaded the source without the CAS on every run. A unit generated from a stack with update_source_with_cas = true and a relative terraform.source kept that relative source, which pointed outside .terragrunt-stack and failed init.
Terragrunt now resolves a ref to the same commit git fetch downloads, so v1.2.3 resolves to the tag. When a branch and a tag share the exact name, the tag wins, as it does for git fetch.
A repository with a hand-edited git tree can list a file at a path git would never write, such as ../../x.tf or a path under a symbolic link in the same tree. The CAS wrote the file where the path pointed, which could be outside the module's download directory.
Terragrunt now checks each path before writing to it and refuses the tree when one escapes the download directory. A path that passes through a symbolic link already present in the download directory is refused too, because the link decides where the write lands.
update_source_with_cas = !false now counts as trueTerragrunt now evaluates the update_source_with_cas expression instead of reading it as a literal value.
.git suffixThe catalog named each clone directory after the clone URL without removing the .git suffix, so https://github.com/acme/terraform-aws-modules.git cloned into a directory called terraform-aws-modules.git. That name appeared in the log line reporting where the repository was cloned, and in the module paths the catalog shows when a repository has no remote to link to. Terragrunt now strips the suffix for HTTPS and SSH clone URLs, git:: sources, and URLs that carry a ref query parameter or a fragment.
The catalog interface's post-scaffold message always reported that terragrunt.hcl had been scaffolded, even when a boilerplate template generated different files (for example root.hcl, or files under config/).
The message now lists the files that were actually written, so it no longer points you at a file that does not exist.
When the catalog cloned a repository through the CAS, it linked each component to a path inside the temporary clone directory instead of to the repository. terragrunt catalog --format=jsonl showed that path in the url field:
{"kind":"module","title":"VPC","url":"/tmp/catalog-7USjxQ-804451847/infrastructure-modules/modules/vpc"}The catalog read the remote and branch from the clone's git metadata, which under the CAS describes the CAS store's own bare repository. That repository records no remote, and its branch is the store's default rather than the source's.
Terragrunt now takes the remote from the clone URL, and the branch from the ref the URL asks for or from the branch the remote's HEAD points at. Under --cas-offline the link uses HEAD, which GitHub and GitLab resolve to the default branch.
A catalog URL that selects a subdirectory, such as github.com/acme/catalog//modules, now loads through the CAS. The url and component_source of each component include that subdirectory.
-destroy=true is treated like -destroyTerragrunt recognized a destroy only when the argument was exactly -destroy. With -destroy=true, which OpenTofu and Terraform accept as the same flag, terragrunt plan -destroy=true and terragrunt apply -destroy=true were not stopped by prevent_destroy, and run --all did not use the reverse order.
Terragrunt now recognizes -destroy=<value> as a destroy when the value is true, parsed the way OpenTofu and Terraform parse boolean flags (1, t, T, TRUE, true and True), whether the argument comes from the command line or from extra_arguments. A false value, such as -destroy=false, is not considered a destroy. The flag is recognized with one dash or two: extra_arguments passes --destroy and --destroy=true to OpenTofu and Terraform as they are written.
Wherever Terragrunt configuration references a command as destroy, apply with the destroy flag counts as destroy and not as apply. That covers exclude actions, the commands of hooks and extra_arguments, mock_outputs_allowed_terraform_commands in a dependency block, and the value of get_terraform_command(). A Git-based filter rejects -destroy=true with the same error it gives for -destroy.
exclude blocks no longer crash on null, unknown or sensitive stringsTerragrunt panicked when if, no_run or exclude_dependencies in an exclude block evaluated to a null, unknown or sensitive string, such as if = tostring(dependency.vpc.outputs.skip).
These strings now behave like the matching bool values:
if reports null value is not allowed.no_run or exclude_dependencies counts as unset.exclude block error.find and list honor if in exclude blocksRunning terragrunt find --queue-construct-as apply or terragrunt list --queue-construct-as apply dropped every unit whose exclude block listed apply, even when the block's if was false:
exclude {
if = false
actions = ["plan", "apply", "destroy"]
}The run queue for run --all apply kept such a unit, so the two commands disagreed about what would run. Both commands now drop a unit only when its exclude block has if = true and lists the action.
Terragrunt skipped the direct state read for every GCS backend that impersonates a service account. Setting impersonate_service_account, GOOGLE_BACKEND_IMPERSONATE_SERVICE_ACCOUNT or GOOGLE_IMPERSONATE_SERVICE_ACCOUNT sent dependency outputs through tofu/terraform output -json instead.
Terragrunt now reads that state directly. The account, its impersonate_service_account_delegates and the devstorage.read_write scope match the native GCS backend. An empty impersonate_service_account reads the state directly without impersonation. When it is empty and an impersonation environment variable is set, Terragrunt uses tofu/terraform output. OpenTofu and Terraform disagree on that input, so the binary decides.
{} groups in glob patterns no longer crash TerragruntSome glob patterns with an empty or unclosed {} group crashed Terragrunt when it matched them, e.g. terragrunt find --filter '{./a{}'. Others silently failed to match, so {}a did not match a.
Terragrunt now refuses these patterns with an invalid pattern error. This covers filter queries, include_in_copy and exclude_from_copy in the terraform block, and .terragrunt-catalog-ignore files. A group with one empty option next to a non-empty one, such as main.tf{,.bak}, still works.
hcl validate reports dependencies on deleted unitsWhen a dependency block pointed at a deleted or moved unit, run --all failed, but find, list and hcl validate passed. hcl validate now fails for every enabled dependency block whose config_path has no unit or stack configuration, so you can catch the problem before a run.
run --all with a Git-based filter, such as --filter '[main...HEAD]', still fails when a dependency block points at a unit or stack that the diff deleted. The error now names the deleted path and the Git reference that still has it:
a dependency points at dep, which exists at main but was deleted or moved in the Git diff
The new missing-dependency-config tip also suggests running hcl validate. find and list behave as before.
hcl validate --inputs reads -var and -var-file arguments verbatimhcl validate --inputs applied shell quoting rules to each entry in extra_arguments before reading -var and -var-file from it. Those rules treat a backslash as an escape character, so on Windows a var file path such as "-var-file=${get_terragrunt_dir()}\\varfiles\\main.tfvars" lost its separators, and validation failed to open the file.
Terragrunt now reads each entry in arguments exactly as written, as the single argument it becomes on the OpenTofu/Terraform command line.
iam_roleWhen two units had the same terragrunt.hcl content, Terragrunt could assume the first unit's IAM role for both. This hit any iam_role that depends on the unit's directory, such as:
iam_role = "arn:aws:iam::123456789012:role/${basename(get_terragrunt_dir())}"With this config in a/ and b/, b assumed role/a instead of role/b. Terragrunt now evaluates iam_role in each unit's own directory, so get_terragrunt_dir(), find_in_parent_folders(), and similar functions return that unit's paths.
source inherited through include is marked as read from the unit's directoryWhen a terraform block with a relative source lived in an included config, find --reading and reading= filters resolved the path against the included file instead of the unit, which is where a run resolves it. The module's files went missing from the unit's reading list, so a change to the module did not select the unit:
# root.hcl
terraform {
source = "${path_relative_from_include()}/modules//foo"
}$ terragrunt find --json --reading
[{"type":"unit","path":"live/unit","reading":["root.hcl"]}]</Note truncated.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This change does not break those promises. It is listed under breaking changes so you are aware of it, in case it affects your workflows.
This is the third and final release candidate for Terragrunt v1.2.
It completes the same eleven experiments as v1.2.0-rc2, and adds nine bug fixes found since then.
Unless someone reports a blocking issue, v1.2.0 will ship with the contents of this release candidate. Only fixes for regressions or other urgent bugs will land before then.
Please try out this release candidate in lower environments and share your feedback in the associated GitHub discussion.
base64gzip() now uses the Go 1.27 gzip encoderGo 1.27 changed the compressed output of its gzip encoder. Terragrunt v1.1.5 kept base64gzip() on the older output and warned once per run that this was legacy behavior. base64gzip() now returns what the Go 1.27 encoder produces.
A resource that compares the encoded value can plan a replacement on the first run after upgrading. An aws_instance with user_data_base64 set from base64gzip() and user_data_replace_on_change set to true is one such resource.
Where the encoded value has to stay stable, call the experimental base64gzip_compat(), which returns the v1.1.3 output permanently. It is behind the base64gzip-compat experiment and may be renamed or removed:
terragrunt run --all --experiment base64gzip-compat -- planinputs = {
user_data_base64 = base64gzip_compat(file("${get_terragrunt_dir()}/user-data.sh"))
}This completes the legacy-base64gzip strict control.
Note
Within the 1.0 guarantees
The 1.0 guarantees make promises about how Terragrunt remains backwards compatible. This change does not break those promises. It is listed under breaking changes so you are aware of it, in case it affects your workflows.
base64gzip() still takes a string and returns valid gzipped base64 content that decompresses to the same value, but the encoded value itself changes. base64gzip_compat() keeps the old one.
When bootstrapping an S3 state bucket, Terragrunt attached a bucket policy statement with the Sid RootAccess that granted s3:* on the bucket and its objects to arn:aws:iam::<account-id>:root, an ARN that grants access to the AWS account as a whole rather than only to its root user. That statement has been removed. It widened reach to state files that routinely hold secrets, and the account already owns the bucket.
The skip_bucket_root_access config no longer has anything to skip, and is now deprecated. Terragrunt still accepts it, and warns about it when bootstrapping a backend whose config sets it. Enable the skip-bucket-root-access strict control to turn that warning into an error.
To grant the AWS account root user access to the state bucket, set the new enable_bucket_root_access config:
# root.hcl
remote_state {
# ... other args omitted for brevity ...
config = {
# ... other config omitted for brevity ...
enable_bucket_root_access = true
}
}Buckets that already have the statement keep it. The state backend docs cover how to remove it yourself.
Note
Within the 1.0 guarantees
The 1.0 guarantees make promises about how Terragrunt remains backwards compatible. This change does not break those promises. It is listed under breaking changes so you are aware of it, in case it affects your workflows.
The bucket policy Terragrunt writes is not part of the CLI, HCL, or output schemas the guarantees pin, and skip_bucket_root_access remains valid configuration. Removing the statement is a bug fix, and enable_bucket_root_access restores it. See Bugs in the guarantees for how a bug fix in 1.x can change your workflows.
terragrunt catalog output with --formatThe catalog TUI needs a terminal. The --format flag (env: TG_FORMAT) writes what the catalog discovers to standard output, so a script or an agent can read the catalog without one.
--format=jsonl writes one JSON object per catalog entry, following a published JSON schema:
terragrunt catalog --format=jsonl | jq -c '{kind, title, component_source}'--format=md writes a Markdown document with a section per entry:
terragrunt catalog --format=md > catalog.mdWithout --format, terragrunt catalog opens the TUI only when standard input and standard output are both terminals. Anywhere else it writes jsonl, so piping the command needs no flag:
terragrunt catalog | jq -c '{kind, title, component_source}'Terragrunt writes each entry as it discovers it. See Non-interactive catalog for the structure of each format and how streaming behaves.
Previously gated behind the catalog-format experiment, non-interactive catalog output no longer requires --experiment catalog-format.
Terragrunt writes CPU, heap, and goroutine profiles on request, so you can see where a slow run spends its time. Pass --profile-cpu, --profile-mem or --profile-goroutine with a path, or --profile-dir to collect all three into one directory under conventional names. Each flag has a matching TG_PROFILE_* environment variable.
terragrunt --profile-dir /tmp/profiles run --all -- planRead the result with go tool pprof. The profiles cover Terragrunt itself, not the OpenTofu/Terraform processes it runs.
Previously gated behind the profiling experiment, the profile flags no longer require --experiment profiling.
--discovery-boundary and (dir) filtersGraph filters search up to the Git repository root for dependents and follow dependencies wherever they point, so in a monorepo they can parse sibling environments a command never needed.
A (dir) operand in a graph filter stops traversal at that directory:
cd environments/staging
terragrunt find --filter '(.)...vpc'From the same directory, the --discovery-boundary flag (env: TG_DISCOVERY_BOUNDARY) applies one boundary to every --filter expression on the command:
terragrunt run --all --filter '...vpc' --discovery-boundary . -- planPreviously gated behind the bounded-discovery experiment, bounded discovery no longer requires --experiment bounded-discovery.
Terragrunt now publishes the read-only Terragrunt docs MCP server, which answers Terragrunt questions from the official docs, the CLI reference, a curated design-pattern library, and real example config. The server is public and unauthenticated. Results are pinned to a Terragrunt version, and docs pages can be read at any release tag from v0.80 onward.
For Claude Code:
claude mcp add -s user --transport http terragrunt-docs https://mcp.docs.terragrunt.com/mcpCursor and other MCP clients that read an mcp.json point at https://mcp.docs.terragrunt.com/mcp instead.
The server is in public beta. It has no availability guarantee and may change significantly.
See the install docs for the full setup.
An oci:// source downloads a module from an OCI Distribution registry, such as Amazon ECR, GitHub Container Registry, Azure Container Registry, Google Artifact Registry, or a self-hosted one. It works in a terraform block:
# terragrunt.hcl
terraform {
source = "oci://ghcr.io/acme/tofu-modules/vpc?tag=1.0.0"
}And in the unit and stack blocks of a terragrunt.stack.hcl:
# terragrunt.stack.hcl
unit "vpc" {
source = "oci://ghcr.io/acme/terragrunt-units/vpc?tag=1.0.0"
path = "vpc"
}Pin the artifact with tag or digest. Setting neither selects the latest tag, and a //subdir selector reaches a directory inside the module, unit, or stack. Credentials come from OpenTofu's CLI config, from ambient Docker config, and from credential helpers such as ecr-login, so one source string resolves the same way under both tofu and Terragrunt.
Previously gated behind the oci experiment, these sources no longer require --experiment oci. See OCI registries for the publishing contract and the full authentication order.
Terragrunt records the files that the built-in file functions read, so reading-based filters select the units that read them without a mark_as_read call:
filetemplatefilefilesetfileexistsfile* hash functions, such as filesha256A file read from inside a template counts too.
mark_as_read remains the way to record a file that only OpenTofu/Terraform reads, such as one passed to a module as an input, or one a run_cmd script reads.
The Content Addressable Store (CAS) now stores the files that generate blocks produce. Each unit's working directory gets a hard link to the stored copy, so every unit that includes this block shares one provider.tf on disk:
# root.hcl
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = "provider \"aws\" {}"
}Generated files are read-only by default, so an existing hook or script that edits a generated file in place fails with a permission error. Set mutable = true on that generate block to give each unit a writable file of its own:
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
mutable = true
contents = "provider \"aws\" {}"
}Passing --no-cas turns off the CAS for a run, and Terragrunt writes generated files as plain files:
terragrunt run --all --no-cas -- planSee Generate blocks and Immutable by default for details.
Previously gated behind the mutable-generate experiment, CAS storage for generated files no longer requires --experiment mutable-generate.
unit, stack, and dependency blocks with expansionAn expansion block adds a count or a for_each to the unit, stack or dependency that contains it, and Terragrunt generates a copy of the block per element.
This unit block generates two units, at .terragrunt-stack/aurora/web and .terragrunt-stack/aurora/api:
# terragrunt.stack.hcl
unit "aurora" {
expansion {
for_each = toset(["web", "api"])
}
source = "../units/app"
path = "aurora/${each.key}"
values = {
role = each.key
}
}A stack block expands the same way, generating one stack per element.
An expanded dependency block produces one dependency per element, and inputs reads each one by its key:
# terragrunt.hcl
dependency "aurora" {
expansion {
for_each = toset(["web", "api"])
}
config_path = "../aurora-${each.key}"
}
inputs = {
web_id = dependency.aurora["web"].outputs.id
}unit and stack blocks also accept an enabled attribute. Setting it to false skips the component during stack generation:
# terragrunt.stack.hcl
unit "canary" {
enabled = false
source = "../units/app"
path = "canary"
}Adding an expansion block to an existing block, or shrinking one, changes the addresses of the components it produces. Read the expansion reference before changing one that has already been applied.
Previously gated behind the block-iteration experiment, expansion blocks and the enabled attribute no longer require --experiment block-iteration.
Terragrunt provisions the resource group, storage account, and blob container backing an azurerm state, and converges blob versioning and soft delete on both new and pre-existing accounts. It also deletes state blobs and containers, and migrates state within a storage account. Dependency outputs of Azure-backed units are read straight from the state blob, the same as S3 and GCS.
If you already pass --backend-bootstrap, Terragrunt now creates Azure resources it skipped before.
Previously gated behind the azure-backend experiment, these operations no longer require --experiment azure-backend. See State Backend for configuration keys and authentication.
The ARM API treats an unset minimum TLS version as TLS1_0, but Azure deprecated TLS1_0 and TLS1_1 in August 2025.
Terragrunt now provisions a new storage account with a minimum TLS version of TLS1_2. The minimum_tls_version option raises it to TLS1_3:
remote_state {
backend = "azurerm"
config = {
storage_account_name = "myterragruntstate"
container_name = "tfstate"
key = "${path_relative_to_include()}/tofu.tfstate"
resource_group_name = "tofu-rg"
use_azuread_auth = true
minimum_tls_version = "TLS1_3"
}
}TLS1_2 and TLS1_3 are the only accepted values. Terragrunt rejects the deprecated TLS1_0 and TLS1_1.
The setting applies only when Terragrunt creates the account. Terragrunt leaves an existing account's setting alone, so change it there with the Azure portal or CLI.
Terragrunt evaluates the built-in functions in configurations using its own copy of the OpenTofu implementations, which tracks OpenTofu 1.13.
These functions are now available:
assumeequalassumelistlengthassumelistlengthmaxassumelistlengthminassumemaplengthassumemaplengthmaxassumemaplengthminassumenotnullassumesetlengthassumesetlengthmaxassumesetlengthminassumestringprefixbase64gunzipcidrcontainsephemeralasnullissensitivetemplatestringurldecodeTerragrunt reads dependency outputs straight from the remote state object, without initializing each dependency to run tofu output or terraform output against it. This covers the S3, GCS, and Azure Storage (azurerm) backends.
When a direct read is unsupported, such as for a backend Terragrunt has no reader for, or fails on a permissions or network error, Terragrunt falls back to tofu/terraform output -json. The outputs are the same either way, so only the speedup is lost.
Pass --no-dependency-fetch-output-from-state (env: TG_NO_DEPENDENCY_FETCH_OUTPUT_FROM_STATE) to always load dependency outputs through tofu/terraform output -json.
Previously gated behind the dependency-fetch-output-from-state experiment, direct state reads no longer require --experiment dependency-fetch-output-from-state. Passing --dependency-fetch-output-from-state still works, and the dependency-fetch-output-from-state strict control turns its deprecation warning into an error.
The terraform block accepts a version attribute holding a version constraint for a tfr:// registry module. Terragrunt downloads the highest published version that satisfies the constraint, using the same syntax as the version argument on OpenTofu and Terraform module blocks:
terraform {
source = "tfr://registry.opentofu.org/terraform-aws-modules/vpc/aws"
version = "~> 3.3"
}See the terraform block reference for the full rules.
Previously gated behind the version-attribute experiment, version constraints for registry modules no longer require --experiment version-attribute.
An account regional namespace is a reserved subdivision of the S3 bucket namespace that only your account can create buckets in, so no one else can take or re-create those names. Bucket names in it end with your account ID, the region, and -an.
When a bucket name matches that convention, Terragrunt creates the bucket in the account regional namespace:
# root.hcl
remote_state {
backend = "s3"
config = {
bucket = "my-tofu-state-111122223333-us-east-1-an"
key = "${path_relative_to_include()}/tofu.tfstate"
region = "us-east-1"
}
}There is no setting to enable this. S3 only accepts the -an suffix for account regional buckets, so naming the bucket like that automatically makes it an account regional namespace bucket. accesslogging_bucket_name is read the same way. Buckets named any other way are created in the global namespace, and the namespace is left out of the request entirely, so S3-compatible object stores are unaffected.
A name that fits the convention but names a region other than the bucket's own fails immediately.
--no-dependency-outputsThe --no-dependency-outputs flag (env: TG_NO_DEPENDENCY_OUTPUTS) skips output resolution for every dependency block in a run, so Terragrunt does not call tofu output on dependencies that may not be applied yet:
terragrunt run --all --no-dependency-outputs -- validateWarning
Use this flag with commands that do not read dependency outputs, such as init and validate. While it is set, references to dependency outputs get no real value, so plan and apply can pass empty values to OpenTofu/Terraform in their place.
Previously gated behind the optional-dependency-outputs experiment, the flag no longer requires --experiment optional-dependency-outputs.
--no-hooksThe --no-hooks flag (env: TG_NO_HOOKS) skips every hook for a run: before_hook, after_hook, and error_hook blocks.
terragrunt run --no-hooks -- planPreviously gated behind the optional-hooks experiment, --no-hooks no longer requires --experiment optional-hooks.
S3 disables ACLs on new buckets by default, and a bucket with ACLs disabled rejects the ACL grant Terragrunt wrote to make an access logging bucket accept logs. AWS recommends a bucket policy over an ACL for this grant, and recommends keeping ACLs disabled in general.
Terragrunt now creates buckets with ACLs disabled and grants access log delivery through the logging bucket's policy instead, allowing s3:PutObject for the logging.s3.amazonaws.com service principal on behalf of buckets in the same AWS account:
remote_state {
backend = "s3"
config = {
bucket = "my-state-bucket"
key = "${path_relative_to_include()}/tofu.tfstate"
region = "us-east-1"
accesslogging_bucket_name = "my-logs-bucket"
}
}This only applies to a logging bucket Terragrunt creates. One that already exists keeps the permissions it has, whether that is the ACL grant from an earlier Terragrunt version or something you set up yourself, and Terragrunt neither reads nor writes its policy.
skip_accesslogging_bucket_policy opts out of that grant. skip_accesslogging_bucket_acl is deprecated and now has no effect: Terragrunt puts no ACL on the logging bucket, so there is nothing left for it to skip.
If you set skip_accesslogging_bucket_acl to work around an AccessControlListNotSupported failure on a bucket with ACLs disabled, drop it. The bucket policy covers that bucket, and the attribute now suppresses nothing. Set skip_accesslogging_bucket_policy only if you grant log delivery yourself. Terragrunt warns when the deprecated attribute is used, and the skip-accesslogging-bucket-acl strict control turns that warning into an error.
assign_blob_data_role sends the principal type of the authenticated identityWhen principal_id was unset, Terragrunt resolved the authenticated identity from its access token but sent the role assignment without a principalType. An identity whose roleAssignments/write permission is constrained by a condition on the principal type, such as a delegated Role Based Access Control Administrator limited to service principals and groups, was then denied the Storage Blob Data Contributor grant.
Terragrunt now sends the principal type it reads from the token. When the token does not state the type, and for an explicitly configured principal_id, the assignment is still sent without a type, so Azure infers it.
include blocks warn againTerragrunt stopped logging the deprecation warning for an include block without a label, so a configuration using one gave no hint that the bare-include strict control would reject it. The parser setup suppressed the warning on the shared control before any file was read, and the check that finds the bare include then had nothing left to log.
A run over a configuration with a bare include now logs the warning once:
WARN Using an `include` block without a label is deprecated. Please use the `include` block with a label instead. For more information, see https://docs.terragrunt.com/migrate/bare-include/
With --strict-mode or --strict-control bare-include, the run still fails with an error and logs no warning. See the bare include migration guide for how to label the block.
expansion works with autoinclude and stack dependenciesterragrunt stack generate failed with There is no variable named "each" when a unit or stack block declared both an expansion block and an autoinclude block. The error pointed at each.key in path, even when autoinclude never referenced each.
Generation now writes an autoinclude file for each element, and each.key, each.value, and count.index inside autoinclude resolve to that element:
# terragrunt.stack.hcl
unit "repo" {
source = "../units/repo"
path = "repo"
}
unit "environment" {
expansion {
for_each = toset(["dev", "prod"])
}
source = "../units/environment"
path = "environment/${each.key}"
autoinclude {
dependency "repo" {
config_path = unit.repo.path
}
inputs = {
environment = each.key
repository = dependency.repo.outputs.name
}
}
}The prod element gets this terragrunt.autoinclude.hcl:
dependency "repo" {
config_path = "../../repo"
}
inputs = {
environment = "prod"
repository = dependency.repo.outputs.name
}A dependency block inside autoinclude that declared its own expansion block failed generation with the same error. A unit whose terragrunt.autoinclude.hcl contained one also failed to parse. An expanded unit could not be referenced from the stack file at all, since unit.<name>.path skipped it.
Each element of an expanded unit or stack is now referenced as unit.<name>[key].path. The generated dependency block keeps its expansion block. Generation evaluates for_each or count in the stack file, where local.* and values.* are available, writes the result as a literal, and resolves config_path for each element. The generated unit expands the dependency when it is parsed:
# terragrunt.stack.hcl
locals {
regions = toset(["us-east-1", "us-west-1"])
}
unit "vpc" {
expansion {
for_each = local.regions
}
source = "../units/vpc"
path = "vpc/${each.key}"
values = {
region = each.key
}
}
unit "app" {
source = "../units/app"
path = "app"
autoinclude {
dependency "vpc" {
expansion {
for_each = local.regions
}
config_path = unit.vpc[each.key].path
mock_outputs = { vpc_id = "vpc-mock-${each.key}" }
}
inputs = {
vpc_ids = { for region, vpc in dependency.vpc : region => vpc.outputs.vpc_id }
}
}
}# .terragrunt-stack/app/terragrunt.autoinclude.hcl
dependency "vpc" {
expansion {
for_each = toset(["us-east-1", "us-west-1"])
}
config_path = {
us-east-1 = "../vpc/us-east-1"
us-west-1 = "../vpc/us-west-1"
}[each.key]
mock_outputs = { vpc_id = "vpc-mock-${each.key}" }
}
inputs = {
vpc_ids = { for region, vpc in dependency.vpc : region => vpc.outputs.vpc_id }
}A stack file that declares the same unit or stack label both with and without an expansion now fails to parse, because unit.<name> cannot refer to both.
Discovery failed the same way on a dependency whose config_path pointed at a stack directory containing an expanded unit. It dropped the dependency instead of reporting the error, so run --all did not wait for the units in that stack. The dependency now covers every element of the expanded unit.
After a fetch that brings in more than about a hundred commits, git starts git maintenance run --auto in the background and returns without waiting for it. That process kept writing commit graphs into the CAS git store for a few seconds after Terragrunt had moved on, outside the lock Terragrunt holds on that store entry, and into temporary clones Terragrunt was already deleting.
Every git fetch Terragrunt runs now turns automatic maintenance off, so the fetch is finished when it returns.
.terragrunt-stack out of local sourcesA stack reading a local source from its own repository, such as source = "../..//catalog/stacks/foo" with update_source_with_cas = true, got a new CAS key on every stack generate, even when the source had not changed.
CAS now leaves .terragrunt-stack out of local sources, like it does for .terraform and .terragrunt-cache.
A source pinned to a tag, such as ?ref=v1.2.3, failed to clone through the CAS when the repository also had a branch whose name ends in the tag name, such as release/v1.2.3, and that branch had moved past the tag:
WARN central git store unavailable for https://github.com/acme/modules.git, falling back to temporary clone: object <release/v1.2.3 commit> not present in central git store after fetching v1.2.3 from https://github.com/acme/modules.git
WARN CAS processing failed for unit "service": failed to CAS clone "https://github.com/acme/modules.git": ... fatal: not a tree object
Terragrunt then downloaded the source without the CAS on every run. A unit generated from a stack with update_source_with_cas = true and a relative terraform.source kept that relative source, which pointed outside .terragrunt-stack and failed init.
Terragrunt now resolves a ref to the same commit git fetch downloads, so v1.2.3 resolves to the tag. When a branch and a tag share the exact name, the tag wins, as it does for git fetch.
A repository with a hand-edited git tree can list a file at a path git would never write, such as ../../x.tf or a path under a symbolic link in the same tree. The CAS wrote the file where the path pointed, which could be outside the module's download directory.
Terragrunt now checks each path before writing to it and refuses the tree when one escapes the download directory. A path that passes through a symbolic link already present in the download directory is refused too, because the link decides where the write lands.
update_source_with_cas = !false now counts as trueTerragrunt now evaluates the update_source_with_cas expression instead of reading it as a literal value.
.git suffixThe catalog named each clone directory after the clone URL without removing the .git suffix, so https://github.com/acme/terraform-aws-modules.git cloned into a directory called terraform-aws-modules.git. That name appeared in the log line reporting where the repository was cloned, and in the module paths the catalog shows when a repository has no remote to link to. Terragrunt now strips the suffix for HTTPS and SSH clone URLs, git:: sources, and URLs that carry a ref query parameter or a fragment.
The catalog interface's post-scaffold message always reported that terragrunt.hcl had been scaffolded, even when a boilerplate template generated different files (for example root.hcl, or files under config/).
The message now lists the files that were actually written, so it no longer points you at a file that does not exist.
When the catalog cloned a repository through the CAS, it linked each component to a path inside the temporary clone directory instead of to the repository. terragrunt catalog --format=jsonl showed that path in the url field:
{"kind":"module","title":"VPC","url":"/tmp/catalog-7USjxQ-804451847/infrastructure-modules/modules/vpc"}The catalog read the remote and branch from the clone's git metadata, which under the CAS describes the CAS store's own bare repository. That repository records no remote, and its branch is the store's default rather than the source's.
Terragrunt now takes the remote from the clone URL, and the branch from the ref the URL asks for or from the branch the remote's HEAD points at. Under --cas-offline the link uses HEAD, which GitHub and GitLab resolve to the default branch.
A catalog URL that selects a subdirectory, such as github.com/acme/catalog//modules, now loads through the CAS. The url and component_source of each component include that subdirectory.
-destroy=true is treated like -destroyTerragrunt recognized a destroy only when the argument was exactly -destroy. With -destroy=true, which OpenTofu and Terraform accept as the same flag, terragrunt plan -destroy=true and terragrunt apply -destroy=true were not stopped by prevent_destroy, and run --all did not use the reverse order.
Terragrunt now recognizes -destroy=<value> as a destroy when the value is true, parsed the way OpenTofu and Terraform parse boolean flags (1, t, T, TRUE, true and True), whether the argument comes from the command line or from extra_arguments. A false value, such as -destroy=false, is not considered a destroy. The flag is recognized with one dash or two: extra_arguments passes --destroy and --destroy=true to OpenTofu and Terraform as they are written.
Wherever Terragrunt configuration references a command as destroy, apply with the destroy flag counts as destroy and not as apply. That covers exclude actions, the commands of hooks and extra_arguments, mock_outputs_allowed_terraform_commands in a dependency block, and the value of get_terraform_command(). A Git-based filter rejects -destroy=true with the same error it gives for -destroy.
exclude blocks no longer crash on null, unknown or sensitive stringsTerragrunt panicked when if, no_run or exclude_dependencies in an exclude block evaluated to a null, unknown or sensitive string, such as if = tostring(dependency.vpc.outputs.skip).
These strings now behave like the matching bool values:
if reports null value is not allowed.no_run or exclude_dependencies counts as unset.exclude block error.find and list honor if in exclude blocksRunning terragrunt find --queue-construct-as apply or terragrunt list --queue-construct-as apply dropped every unit whose exclude block listed apply, even when the block's if was false:
exclude {
if = false
actions = ["plan", "apply", "destroy"]
}The run queue for run --all apply kept such a unit, so the two commands disagreed about what would run. Both commands now drop a unit only when its exclude block has if = true and lists the action.
Terragrunt skipped the direct state read for every GCS backend that impersonates a service account. Setting impersonate_service_account, GOOGLE_BACKEND_IMPERSONATE_SERVICE_ACCOUNT or GOOGLE_IMPERSONATE_SERVICE_ACCOUNT sent dependency outputs through tofu/terraform output -json instead.
Terragrunt now reads that state directly. The account, its impersonate_service_account_delegates and the devstorage.read_write scope match the native GCS backend. An empty impersonate_service_account reads the state directly without impersonation. When it is empty and an impersonation environment variable is set, Terragrunt uses tofu/terraform output. OpenTofu and Terraform disagree on that input, so the binary decides.
{} groups in glob patterns no longer crash TerragruntSome glob patterns with an empty or unclosed {} group crashed Terragrunt when it matched them, e.g. terragrunt find --filter '{./a{}'. Others silently failed to match, so {}a did not match a.
Terragrunt now refuses these patterns with an invalid pattern error. This covers filter queries, include_in_copy and exclude_from_copy in the terraform block, and .terragrunt-catalog-ignore files. A group with one empty option next to a non-empty one, such as main.tf{,.bak}, still works.
hcl validate reports dependencies on deleted unitsWhen a dependency block pointed at a deleted or moved unit, run --all failed, but find, list and hcl validate passed. hcl validate now fails for every enabled dependency block whose config_path has no unit or stack configuration, so you can catch the problem before a run.
run --all with a Git-based filter, such as --filter '[main...HEAD]', still fails when a dependency block points at a unit or stack that the diff deleted. The error now names the deleted path and the Git reference that still has it:
a dependency points at dep, which exists at main but was deleted or moved in the Git diff
The new missing-dependency-config tip also suggests running hcl validate. find and list behave as before.
hcl validate --inputs reads -var and -var-file arguments verbatimhcl validate --inputs applied shell quoting rules to each entry in extra_arguments before reading -var and -var-file from it. Those rules treat a backslash as an escape character, so on Windows a var file path such as "-var-file=${get_terragrunt_dir()}\\varfiles\\main.tfvars" lost its separators, and validation failed to open the file.
Terragrunt now reads each entry in arguments exactly as written, as the single argument it becomes on the OpenTofu/Terraform command line.
iam_roleWhen two units had the same terragrunt.hcl content, Terragrunt could assume the first unit's IAM role for both. This hit any iam_role that depends on the unit's directory, such as:
iam_role = "arn:aws:iam::123456789012:role/${basename(get_terragrunt_dir())}"With this config in a/ and b/, b assumed role/a instead of role/b. Terragrunt now evaluates iam_role in each unit's own directory, so get_terragrunt_dir(), find_in_parent_folders(), and similar functions return that unit's paths.
source inherited through include is marked as read from the unit's directoryWhen a terraform block with a relative source lived in an included config, find --reading and reading= filters resolved the path against the included file instead of the unit, which is where a run resolves it. The module's files went missing from the unit's reading list, so a change to the module did not select the unit:
# root.hcl
terraform {
source = "${path_relative_from_include()}/modules//foo"
}$ terragrunt find --json --reading
[{"type":"unit","path":"live/unit","reading":["root.hcl"]}]Terragrunt now resolves the source against the unit's directory, so modules/foo/main.tf appears in reading and reading-based filters select the unit the same way they do for an absolute source.
terragrunt info print --all writes JSON Lines and reports each unit's own download directoryinfo print --all wrote each unit's info indented over several lines, one object after another, and gave every unit the root's download_dir:
$ terragrunt info print --all
{
"config_path": "/example/live/db/terragrunt.hcl",
"download_dirNote truncated.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.