Active Experiments
The following experiments are available for opt-in. See the experiments overview for how to enable them.
auth-provider-cache
Reuse of one --auth-provider-cmd response across the units that share its credentials.
This experiment is ongoing and disabled by default. Without it, Terragrunt ignores the cache object in the response and runs the command for every unit.
auth-provider-cache - What it does
Terragrunt runs the auth provider command several times for every unit. With this experiment enabled, the command can return a cache object with a list of glob patterns and a ttl. Terragrunt reuses the response for every unit whose directory matches one of the patterns, until the ttl expires.
{ "awsCredentials": { "ACCESS_KEY_ID": "fake-access-key-id", "SECRET_ACCESS_KEY": "fake-secret-access-key", "SESSION_TOKEN": "fake-session-token" }, "cache": { "root": "repo", "globs": ["dev/**"], "ttl": 900 }}terragrunt run --all --experiment auth-provider-cache --auth-provider-cmd /path/to/auth-script.sh -- planrootis the directory the globs are relative to. The only value isrepo, the top level of the git repository that contains the unit, as returned byget_repo_root().globsis a list of patterns matched against the unit directory relative toroot, with forward slashes. They use the glob syntax of a--filterpath:*matches within one path segment,**matches across segments, and{a,b}matches either alternative, sodev/**matches every directory underdev. The response is reused for a unit that matches any pattern. At least one pattern must match the unit the command ran for, and the list can have up to 256 patterns.ttlis how many seconds Terragrunt reuses the response, up to86400(24 hours). Terragrunt reuses a response with a longerttlfor 24 hours and logs a warning. Set it below the remaining lifetime of the credentials.0disables caching for the response.
Terragrunt runs the command in the unit directory, so the command can choose its globs from its working directory.
If the cache object is invalid, Terragrunt logs a warning and uses the credentials for that unit only. When cached responses with different globs match the same unit, Terragrunt uses any one of them, so return globs that do not overlap unless the overlapping responses are interchangeable.
The full response schema is published at /schemas/auth-provider-cmd/v3/schema.json.
Fetching credentials once for units that run in parallel
Terragrunt runs units in parallel, so several units that share credentials can run the command before the first response is cached, and each of them fetches the credentials. To fetch them once, the command can return the cache object alone, with a negative ttl, before it fetches anything:
{ "cache": { "root": "repo", "globs": ["dev/**"], "ttl": -1 }}Terragrunt then runs the command one more time for all the units that got the same root and globs back. On that run the command fetches the credentials and returns them with a positive ttl. If the cache object of a response with a negative ttl is invalid, Terragrunt returns an error for that unit, because the response has no credentials to use. If that run returns a negative ttl again, Terragrunt returns an error for every unit waiting on it.
Terragrunt sets two environment variables on the command:
TG_CTX_AUTH_PROVIDER_SCHEMAis the version of the response schema Terragrunt reads, on every run.TG_CTX_AUTH_PROVIDER_CACHE_KEYis therootandglobsof the response with a negativettl, as JSON. Terragrunt sets it only on the run that follows that response, so the command can tell the two runs apart.
The following script shares one set of credentials among the units in each top-level directory of the repository:
#!/usr/bin/env bash
set -euo pipefail
# Path of the unit directory below the repository root, e.g. dev/vpc/unit="$(git rev-parse --show-prefix)"environment="${unit%%/*}"
cache="$(jq -n --arg env "$environment" '{root: "repo", globs: [$env, $env + "/**"]}')"
schema="${TG_CTX_AUTH_PROVIDER_SCHEMA:-v0}"
if (( ${schema#v} >= 3 )) && [[ -z "${TG_CTX_AUTH_PROVIDER_CACHE_KEY:-}" ]]; then jq -n --argjson cache "$cache" '{cache: ($cache + {ttl: -1})}' exit 0fi
# Fetch the credentials for $environment here, into the three variables below.
jq -n \ --argjson cache "$cache" \ --arg access_key_id "$access_key_id" \ --arg secret_access_key "$secret_access_key" \ --arg session_token "$session_token" \ '{ awsCredentials: { ACCESS_KEY_ID: $access_key_id, SECRET_ACCESS_KEY: $secret_access_key, SESSION_TOKEN: $session_token }, cache: ($cache + {ttl: 900}) }'auth-provider-cache - How to provide feedback
Provide your feedback in the auth-provider-cache GitHub Discussion.
auth-provider-cache - Criteria for stabilization
To transition the auth-provider-cache feature to a stable release, the following must be addressed:
- Community feedback on real-world usage.
base64gzip-compat
Support for the base64gzip_compat HCL function.
This experiment is ongoing and disabled by default. The base64gzip_compat function is not generally available while the experiment runs, and calling it without the experiment enabled returns an error. It becomes generally available once every item in the stabilization criteria below is met.
base64gzip-compat - What it does
When enabled, Terragrunt exposes a base64gzip_compat(str) HCL function that returns the value base64gzip(str) returned in Terragrunt v1.1.3 and earlier, and keeps returning it after Terragrunt 1.2 switches base64gzip() to the current Go encoder.
Use it where the encoded value must stay stable across upgrades, such as an EC2 instance with user_data_base64 and user_data_replace_on_change = true.
terragrunt run --all --experiment base64gzip-compat -- planbase64gzip-compat - How to provide feedback
Provide your feedback in the base64gzip-compat GitHub Discussion, describing where you need stable base64gzip() output.
base64gzip-compat - Criteria for stabilization
To transition the base64gzip-compat feature to a stable release, the following must be addressed:
- Agree on the function name with OpenTofu so both tools expose the same compatibility function.
- Confirm the output stays byte-identical across Terragrunt and Go releases.
browse-tui
Adds the terragrunt browse command, which browses the discovered infrastructure estate in an interactive terminal user interface (TUI).
browse-tui - What it does
With the experiment enabled, terragrunt browse opens a yazi-style, three-column browser of the discovered estate. See the browse command documentation for usage and keybindings.
Running terragrunt browse without the experiment enabled is an error.
browse-tui - How to provide feedback
Provide your feedback on the browse-tui GitHub Discussion.
browse-tui - Criteria for stabilization
To transition the browse-tui feature to a stable release, the following must be addressed:
- The browser renders large estates without noticeable latency.
- Actions for running commands against a highlighted unit or stack are implemented.
- The same TUI is shared with the
catalogscaffolding experience. - Positive feedback from users browsing real infrastructure estates.
- Integration tests covering the core browsing workflow.
deep-merge
Support for the deep_merge HCL function.
deep-merge - What it does
When enabled, Terragrunt exposes a deep_merge(map1, map2, ...) HCL function for combining map or object values.
For overlapping keys, values from later arguments override earlier arguments. Nested maps are merged recursively, lists are appended, and null arguments are ignored.
This is useful when building inputs from multiple JSON, YAML, or HCL-derived maps without having to rely on include block merge behavior.
terragrunt run --all --experiment deep-merge -- plandeep-merge - How to provide feedback
Provide your feedback in the deep-merge GitHub Discussion.
deep-merge - Criteria for stabilization
To transition the deep-merge feature to a stable release, the following must be addressed:
- Confirm the merge semantics are useful for common configuration layering workflows.
- Confirm type handling for decoded JSON/YAML and native HCL objects matches user expectations.
- Positive feedback from users relying on the function in production pipelines.
empty-dependency-outputs
Support for dependency blocks on units that have no outputs.
This experiment is ongoing and disabled by default. Without it, a dependency block returns an error when its unit has no outputs and no mock_outputs apply.
empty-dependency-outputs - What it does
A dependency block reads the outputs of the unit it points at. With this experiment enabled, dependency.<name>.outputs is an empty object when that unit has no outputs or has not been applied, so a dependency block can order a unit after another without reading anything from it.
dependency "vpc" { config_path = "../vpc"}terragrunt run --experiment empty-dependency-outputs -- planTogether with an expansion block, this orders a unit after a computed set of paths, which otherwise takes a dependencies block.
dependency "upstream" { expansion { for_each = toset(["../vpc", "../rds"]) }
config_path = each.value}mock_outputs still take precedence when they apply. Terragrunt still reads the unit’s state to look for outputs. Set skip_outputs = true to skip that read.
empty-dependency-outputs - How to provide feedback
Provide your feedback in the empty-dependency-outputs GitHub Discussion.
empty-dependency-outputs - Criteria for stabilization
To transition the empty-dependency-outputs feature to a stable release, the following must be addressed:
- Community feedback on real-world usage.
- Decide whether a
dependencyblock still reads state when the configuration references none of its outputs.
hook-context-env
Expose additional TG_CTX_* environment variables to hook scripts.
hook-context-env - What it does
When enabled, Terragrunt sets three additional environment variables on the process running every before_hook, after_hook, and error_hook:
TG_CTX_HOOK_TYPE—before_hook,after_hook, orerror_hook, depending on which lifecycle phase is executing the hook.TG_CTX_SOURCE— the resolved terraform source URL for the current unit, matching the precedence Terragrunt uses for the actual download: the--sourceCLI override if set, otherwise the evaluatedterraform.source(with--source-mapapplied), otherwise..TG_CTX_TERRAGRUNT_DIR— the directory containing the current Terragrunt config (equivalent toget_terragrunt_dir()).
These variables make it easier for hook scripts to branch on lifecycle phase, to know whether the unit pulls remote source, and to locate the config directory without having to thread that information through hook arguments.
terragrunt run --all --experiment hook-context-env -- applyExample hook script:
#!/usr/bin/env bash
case "$TG_CTX_HOOK_TYPE" in before_hook) echo "preparing $TG_CTX_TERRAGRUNT_DIR" ;; after_hook) echo "cleaning up $TG_CTX_TERRAGRUNT_DIR" ;; error_hook) echo "failure in $TG_CTX_TERRAGRUNT_DIR" ;;esac
if [ "$TG_CTX_SOURCE" != "." ]; then echo "unit uses source: $TG_CTX_SOURCE"fihook-context-env - How to provide feedback
Provide your feedback in the hook-context-env GitHub Discussion.
hook-context-env - Criteria for stabilization
To transition the hook-context-env feature to a stable release, the following must be addressed:
- Confirm the three new variables cover the most common hook scripting needs.
- Confirm the chosen variable names and values (
before_hook/after_hook/error_hook) match user expectations. - Positive feedback from users relying on the variables in production hook scripts.
iac-engine
Support for Terragrunt IaC engines.
iac-engine - What it does
Enables usage of Terragrunt IaC engines for running IaC operations. This allows Terragrunt to use pluggable engines to execute OpenTofu/Terraform commands, providing enhanced functionality and extensibility.
IaC engines are still experimental, as the API is unstable and may change in future minor versions of Terragrunt.
You can disable engine usage on a per-command basis using the --no-engine flag, even when the experiment is enabled globally.
iac-engine - How to provide feedback
Provide your feedback on the Terragrunt IaC Engines GitHub discussion.
iac-engine - Criteria for stabilization
To transition the iac-engine feature to a stable release, the following must be addressed, at a minimum:
- API stability and backward compatibility guarantees
- Comprehensive integration testing across all supported operations
- Documentation of engine development and integration process
- Performance benchmarks and optimization
- Security review of engine execution and isolation mechanisms
- Community feedback on real-world usage and edge cases
mcp-command
Adds the terragrunt mcp command, which serves Terragrunt operations to AI agents over the Model Context Protocol.
mcp-command - What it does
With the experiment enabled, terragrunt mcp speaks the Model Context Protocol over standard input and output, so an agent can ask Terragrunt questions about your estate instead of guessing at them from the HCL. It serves these tools:
| Name | What it does |
|---|---|
discover |
Which units and stacks exist under a directory, and how they depend on each other |
render_config |
What one unit’s terragrunt.hcl resolves to, once locals, includes, and dependency outputs are evaluated |
validate |
Whether the configurations under a directory parse and evaluate, as file/line diagnostics |
run_order |
What must finish before each unit may start, for the command you name |
get_outputs |
The applied outputs of one unit |
plan |
The per-unit result of run --all plan |
catalog |
The components terragrunt catalog returns |
scaffold |
New configuration written from a module, unit, or stack source, as terragrunt scaffold writes it |
fmt |
Rewrites .hcl files into canonical format, as hcl fmt does, or with check reports the files that need it without changing any |
docs_* |
The tools of the Terragrunt docs MCP server, served only under --allow=docs |
apply, destroy |
The per-unit result of a real change, served only under --dangerously-allow-apply and gated on a person accepting it |
run_order takes the command it should answer for. plan and apply order alike, and only destroy inverts, but an exclude block naming one action does not match another, so the three can cover different sets of units.
Every tool is confined to the directory the server was launched in. A working_dir argument that resolves outside it is refused, and graph traversal is bounded there too, so a filter that follows dependencies or dependents cannot bring back a unit from a tree the server was never pointed at. A unit across that boundary still has its configuration read, so units inside can be ordered against it and fetch its outputs.
That confinement covers working_dir and traversal, not file access. Tools work against the real filesystem, so a dependency fetch writes that dependency’s source into a .terragrunt-cache, and an HCL function such as file() reads anything the user running the server can.
The server denies every capability at startup, and grants them separately.
-
--allow=sopslets it decrypt SOPS-encrypted files. Without itsops_decrypt_filefails rather than putting cleartext in front of the agent. -
--allow=execlets it run thetofu,terraform, andgitTerragrunt starts to do its own work. Without it none of them run. A program a configuration names throughrun_cmd(), a hook, or an auth-provider command stays refused even with it, including atofu,terraform, orgitthe configuration names for itself, since the agent picks the repository and a configuration under it could otherwise name any program on the machine. Allow one with an--allow-cmdpattern, or let the read-only tools offer the refused programs to the person operating the client and run again with what they accept. -
--allow=httplets it make requests. Without it every request Terragrunt makes on its own account fails, so state backends, registries, and remote module sources are unreachable, and a unit whoseterraformsource is remote cannot be planned at all. -
--allow=envpasses its environment variables to configurations and the commands the tools run. Without it they start from an empty environment, soget_env()returns its default. -
--allow=docsrelays the tools and resources of the Terragrunt docs MCP server, each tool under adocs_prefix. Without it the server sends nothing to the docs server.
With none granted, Terragrunt refuses the commands and requests the tools would otherwise make. A result a restriction affected carries a degraded list naming what was substituted, such as a dependency output that fell back to mock_outputs, a run_cmd that returned an empty string, or outputs that were not fetched. plan needs real commands, so it is refused outright. get_outputs needs either exec or http, since it runs the real output command or reads remote state itself. The second path works for a unit whose remote_state backend is s3, gcs, or azurerm; any other unit reports that it fetched nothing and says why.
Granting one does not bound another. A process started under --allow=exec reaches the network on its own account, so tofu init downloads providers whether or not --allow=http was passed. Denying HTTP restricts Terragrunt, not the tools it runs.
None of this makes the server a sandbox. The restrictions limit what Terragrunt does when a tool asks it to. They do not contain a program Terragrunt starts, and an agent that can run shell commands can run Terragrunt itself without them.
A separate flag, --dangerously-allow-apply, adds apply and destroy tools on top of --allow=exec. It is spelled out in full rather than being a value of --allow, because it is the one that changes infrastructure. Without it neither tool is registered, so a client is never told they exist. With it, an agent can reach real infrastructure, though not on its own say-so. Each run is described to the person operating the client through an elicitation (the protocol’s way for a server to ask the client’s user a question), and starts only once they accept. A client that cannot ask anyone is refused. The client draws that prompt, so it stops an agent acting unobserved rather than acting without authorization. Read the flag documentation before granting it.
Running terragrunt mcp without the experiment enabled is an error.
mcp-command - How to enable it
# Via CLI flagterragrunt --experiment mcp-command mcp
# Via environment variableexport TG_EXPERIMENT=mcp-commandterragrunt mcpAgents launch the server themselves, so the experiment is usually set in the client’s server configuration:
{ "mcpServers": { "terragrunt": { "command": "terragrunt", "args": ["mcp"], "env": { "TG_EXPERIMENT": "mcp-command" } } }}mcp-command - How to provide feedback
Provide your feedback in the mcp-command GitHub Discussion.
When reporting issues or providing feedback, please include:
- The agent or MCP client you connected with.
- Which capabilities you granted, and what the
degradedlists said for the ones you did not grant. - The questions you wanted to ask that no tool answered.
mcp-command - Criteria for stabilization
This will not stabilize before v1.3. The open items below include whether the mutating tools should be served at all and whether stdio is the right transport, and settling those needs feedback from people running the server against real estates. Until then, treat the tool set, the flag names, and the shape of every result as subject to change, and pin a Terragrunt version if you build against them.
To transition the mcp-command feature to a stable release, the following must be addressed, at a minimum:
- A tool set covering discovery, configuration rendering, validation, run ordering, outputs, and plan.
- Confinement of every tool call to the directory the server was launched in.
- A default that refuses the commands and requests Terragrunt would make, with results that say what was degraded by it.
- A default that passes none of the server’s environment variables to tool calls, with a capability that grants them.
- A boundary between the commands Terragrunt runs and the programs a configuration names that holds when a configuration names
tofu,terraform, orgititself, so pointing the server at a repository does not hand it those programs. - An approval step in front of every mutating run, carried by the protocol’s own elicitation rather than left to the operator.
- Whether serving mutating tools at all is the right call, given that the client draws the approval and Terragrunt cannot verify a person answered it.
- A transport other than stdio, for clients that cannot launch a local process.
- Feedback from agents driving the tool set against real estates.
no-dot-terragrunt-cache
Support for the terraform.no_dot_terragrunt_cache attribute, which runs a unit from its own directory instead of a copy in .terragrunt-cache.
This experiment is ongoing and disabled by default. Setting the attribute to true without the experiment enabled returns an error. It becomes generally available once every item in the stabilization criteria below is met.
no-dot-terragrunt-cache - What it does
Terragrunt normally copies a unit into .terragrunt-cache and runs OpenTofu/Terraform there. With this experiment enabled, terraform.no_dot_terragrunt_cache = true runs it in the unit directory instead. Local module paths resolve as written, and editors see the files Terragrunt runs.
terraform { no_dot_terragrunt_cache = true}terragrunt run --experiment no-dot-terragrunt-cache -- planFiles that a run creates stay in the unit directory: the output of generate blocks, the .terraform directory, .terraform.lock.hcl, and local state. Add the ones you do not want to commit to .gitignore. When an input is null, Terragrunt writes a temporary .terragrunt-null-vars.auto.tfvars.json for the run and removes it afterwards. If a file with that name already exists, the run stops with an error rather than replacing it. The tfvar and json kinds of a variables block do the same with terragrunt.auto.tfvars and terragrunt.auto.tfvars.json.
The attribute is merged through include like the other terraform attributes: a root configuration found with find_in_parent_folders() can set it for every unit, and a unit can override it in its own terraform block.
Setting the attribute to true on a unit that also has a terraform.source or --source returns an error, because an external source has to be fetched into .terragrunt-cache.
no-dot-terragrunt-cache - How to provide feedback
Provide your feedback in the no-dot-terragrunt-cache GitHub Discussion.
no-dot-terragrunt-cache - Criteria for stabilization
To transition the no-dot-terragrunt-cache feature to a stable release, the following must be addressed:
- Validate
before_hookandafter_hookblocks that use relative paths. - Validate
generateblocks that write into the unit directory. - Validate runs where
--working-diris not the unit directory.
offline-cas
Control over the probe cache the CAS keeps, including resolving a run without contacting any remote.
offline-cas - What it does
This experiment turns on the probe cache. The CAS records the answer to each cheap probe it makes, for every source it probes, so a later run can learn what a source resolves to without querying the remote again. An answer for a source pinned to a specific revision is served for 24 hours; anything that can change upstream is probed again on every run.
Three flags come with it and change how the recorded answers are used:
--cas-offlinenever contacts a remote. Every source is answered from its recorded probe, however old, and linked from the local store. A source with no recorded answer, or whose content the store lacks, fails with an error naming it instead of being fetched.--cas-refreshignores the recorded answers for one run and asks every remote again, then records what it learns. Use it when a version tag has moved and the 24 hour window for pinned sources has not passed.--cas-probe-ttltrusts a recorded probe of a source that can change upstream for a chosen duration, such as10m, rather than probing it on every run.
terragrunt run --experiment offline-cas --all --cas-offline -- planThe flags are available on the same commands as --no-cas. --cas-offline and --cas-refresh cannot be combined. A source with no cheap probe, such as an SMB share, has no answer to record and is fetched on every run. With the experiment off, nothing is recorded or served and every run probes every source.
offline-cas - How to enable it
# Via CLI flagterragrunt run --experiment offline-cas --all --cas-probe-ttl 10m -- plan
# Via environment variableexport TG_EXPERIMENT=offline-casterragrunt run --all --cas-probe-ttl 10m -- planSetting one of the three flags without the experiment returns an error naming the flag.
offline-cas - How to provide feedback
Provide your feedback in the offline-cas GitHub Discussion.
offline-cas - Criteria for stabilization
To transition the offline-cas feature to a stable release, the following must be addressed, at a minimum:
- Confirm an offline run reports every unresolvable source in one pass, rather than failing on the first one.
- Decide whether the sources with no cheap probe (SMB shares) should be resolvable offline, or whether failing on them is right.
- Decide whether a warm store should be reachable without a prior online run, such as through a store that can be built and shipped to an air-gapped host.
- Decide whether the 24 hour window for pinned sources belongs under
--cas-probe-ttlor stays separate. - Decide how the store is pruned, covering recorded answers and the much larger content beside them, so a long-lived store does not keep growing on sources that are gone. Marking an answer as used when it is served, so that age since last use drives eviction rather than age since recording, is the likely mechanism.
- Community feedback from air-gapped and high-unit-count runs on whether the three flags cover their needs.
otel-logs
Export Terragrunt’s logs as an OpenTelemetry logs signal.
otel-logs - What it does
When enabled, Terragrunt emits its log output as OpenTelemetry log records in addition to the existing traces and metrics signals. The exporter is selected with TG_TELEMETRY_LOGS_EXPORTER:
none- no log exporting (the default).console- write log records to the console as JSON.otlpHttp- export logs to an OpenTelemetry collector over HTTP.otlpGrpc- export logs to an OpenTelemetry collector over gRPC.
The OTLP exporters read their endpoint from the standard OTEL_EXPORTER_OTLP_ENDPOINT environment variable. Set TG_TELEMETRY_LOGS_EXPORTER_INSECURE_ENDPOINT=true to disable TLS and send logs over an insecure connection. Only use this for local collection.
TG_TELEMETRY_LOGS_EXPORTER=otlpHttp terragrunt run --all --experiment otel-logs -- applyRecords emitted while a unit’s span is active carry that span’s trace and span IDs, so a failed unit’s logs link back to its span in the backend: clicking a unit’s span in the trace view surfaces exactly the logs it produced. Run-level records emitted outside a unit span, such as the run queue, carry the IDs of the root command span. Without the experiment enabled, the logs exporter stays inert regardless of TG_TELEMETRY_LOGS_EXPORTER.
otel-logs - How to provide feedback
Provide your feedback in the otel-logs GitHub Discussion.
otel-logs - Criteria for stabilization
To transition the otel-logs feature to a stable release, the following must be addressed:
- Confirm the exporter types and configuration cover common collector setups.
- Validate log volume and batching behavior on large stacks.
- Confirm trace/span correlation is reliable across the run lifecycle, including run-level logs emitted outside a unit span.
- Settle on the dependency stability story for the OpenTelemetry logs SDK, which is still pre-1.0.
outputs-block
Support for the outputs block on units, which declares the outputs a unit emits along with the mock value and mocking strategy its dependents use while its state has no outputs.
This experiment is ongoing and disabled by default. Declaring the block without the experiment enabled returns an error. It becomes generally available once every item in the stabilization criteria below is met.
outputs-block - What it does
Without the block, every dependency block that reads a unit sets its own mock_outputs, so ten dependents of a VPC unit repeat the same mock values ten times. With this experiment enabled, the VPC unit declares its outputs once:
outputs { mock_strategy { allowed_commands = ["validate", "plan"] }
output "vpc_id" { mock_value = "vpc-mock-id" }
output "subnet_ids" { mock_value = ["subnet-mock-1", "subnet-mock-2"] }}Dependents read them through their dependency blocks without setting mock_outputs:
dependency "vpc" { config_path = "../vpc"}
inputs = { vpc_id = dependency.vpc.outputs.vpc_id subnet_ids = dependency.vpc.outputs.subnet_ids}terragrunt run --all --experiment outputs-block -- planA dependent that needs a different mock still sets mock_outputs, which wins key by key. mock_outputs_allowed_terraform_commands and mock_outputs_merge_strategy_with_state on the dependency block win over mock_strategy when set.
terragrunt hcl validate --outputs checks that every declared output exists in the OpenTofu/Terraform module the unit runs, and that every dependency.<name>.outputs.<output> reference names an output the dependency declares. See the outputs block reference.
outputs-block - How to provide feedback
Provide your feedback on the outputs-block GitHub discussion.
outputs-block - Criteria for stabilization
To transition the outputs-block feature to a stable release, the following must be addressed:
- Decide whether a
typeattribute onoutputblocks adds value over the types the module declares. - Decide whether
mock_strategyis also allowed inside individualoutputblocks. - Support
outputsblocks on the units of a stack that adependencyblock points at. - Decide how a
mock_outputskey that the dependency does not declare is reported.
path-variable
Support for the path variable, which exposes the paths of the unit, the stack, the download directory, the included file and the read file by name.
This experiment is ongoing and disabled by default. A reference to path without the experiment enabled returns an error. It becomes generally available once every item in the stabilization criteria below is met.
path-variable - What it does
Functions such as get_terragrunt_dir() and get_parent_terragrunt_dir() return a different directory in a unit, in an included file and in a file that read_terragrunt_config reads. With this experiment enabled, each field of path names one location:
| Field | Value |
|---|---|
path.unit |
Absolute path to the directory of the unit, which holds its terragrunt.hcl. |
path.stack |
Absolute path to the directory of the terragrunt.stack.hcl that Terragrunt evaluates. |
path.download |
Absolute path to the directory in which Terragrunt runs OpenTofu/Terraform for the unit. |
path.include |
Absolute path to the included file, e.g. /path/to/root.hcl. |
path.read |
Absolute path to the file that read_terragrunt_config reads, e.g. /path/to/env.hcl. |
remote_state { backend = "s3"
config = { bucket = "my-tofu-state" key = "${trimprefix(path.unit, "${dirname(path.include)}/")}/tofu.tfstate" region = "us-east-1" }}terragrunt run --all --experiment path-variable -- planA field is defined only where its location exists, e.g. path.unit is not defined in terragrunt.stack.hcl, and path.stack is not defined in a unit. See the path variable reference for each field, with examples.
path-variable - How to provide feedback
Provide your feedback in the Terragrunt GitHub Discussions.
path-variable - Criteria for stabilization
To transition the path-variable feature to a stable release, the following must be addressed:
- Agree on the field names, and on an error or a
nullvalue for a field that is not defined. - Add reference documentation for the
pathvariable. - Support the
pathvariable interragrunt-ls. - Serve the
pathvariable reference through the Terragrunt docs MCP server. - Positive feedback from users that replace the path functions with
path.
slow-task-reporting
Shows progress for slow operations, so a long wait does not look like a hang.
slow-task-reporting - What it does
Terragrunt reports an operation that runs longer than a short threshold. These operations are reported:
- Source downloads, and waits for the download directory lock or the Git store lock
- Git worktree creation and Git reference comparison for
--filter - Unit discovery for
run --all,findandlist dependencyoutput fetches- Provider caching
- Waits for a new S3 bucket, DynamoDB table or GCS bucket to be ready
- Unit and stack fetches during
stack generate - Repository clones in
terragrunt catalog
On a terminal, Terragrunt draws one progress line with the operation, its elapsed time, and the number of other running operations:
| Downloading source from git::https://github.com/acme/modules.git?ref=v1.2.0... (12s) +2 moreThe line is cut to the terminal width. Log lines are written above it. When the operation succeeds, Terragrunt replaces the line with an INFO log line, with the elapsed time if it took 1s or more. In run --all, all units share the line, and it shows the oldest running operation.
Otherwise, Terragrunt writes INFO log lines: one when the operation is first reported, one every 30 seconds while it runs, and one when it succeeds. The 30-second lines keep CI systems from stopping a job that looks idle.
INFO Fetching outputs of dependency ../vpc/terragrunt.hcl...INFO Fetching outputs of dependency ../vpc/terragrunt.hcl... (30s elapsed)INFO Fetched outputs of dependency ../vpc/terragrunt.hcl (41.7s)Terragrunt writes log lines instead of the progress line when:
- Stderr is not a terminal, or the terminal is narrower than 20 columns.
TERMis unset ordumb. On Windows,TERMis not needed, but the console must support ANSI escape sequences.CIis set to anything butfalse,0,nooroff, orTF_BUILD,TEAMCITY_VERSION,JENKINS_URLorTF_IN_AUTOMATIONis set.- Logs use the
jsonformat.
To get log lines on a terminal, set TERM=dumb or CI=true. terragrunt catalog never draws the progress line, because its TUI uses the terminal.
With --log-level warn or higher, or with --log-disable, nothing is reported.
The spinner uses Unicode characters on UTF-8 terminals and in Windows Terminal, and |, /, -, \ elsewhere.
terragrunt run --all --experiment slow-task-reporting -- planslow-task-reporting - How to provide feedback
Provide your feedback on the slow-task-reporting GitHub Discussion.
slow-task-reporting - Criteria for stabilization
To transition the slow-task-reporting feature to a stable release, the following must be addressed:
- Validate the progress line across common terminal emulators (iTerm2, Terminal.app, Windows Terminal, the Windows console, GNOME Terminal)
- Extend progress reporting to additional slow operations (e.g., provider caching)
- Community feedback on usefulness and threshold tuning
- Ensure no interference with structured log output when using
--log-format json - Ensure no interference with the output of units that run concurrently, or with the catalog TUI
symlinks
Support symlink resolution for Terragrunt units.
symlinks - What it does
By default, Terragrunt will ignore symlinks when determining which units it should run. By enabling this experiment, Terragrunt will resolve symlinks and add them to the list of units being run.
It also makes include_in_copy and exclude_from_copy glob patterns rooted at a symlinked directory expand through the link, so the contents of a linked directory are copied into (or excluded from) the OpenTofu/Terraform working directory. A link that points back at a directory already being copied, or at a parent of one, is skipped with a warning.
symlinks - How to provide feedback
Provide your feedback on the Experiment: Symlinks discussion.
symlinks - Criteria for stabilization
To stabilize this feature, the following need to be resolved, at a minimum:
- Ensure that symlink support continues to work for users referencing symlinks in flags. See #3622.
- Add integration tests for all filesystem flags to confirm support with symlinks (or document the fact that they cannot be supported).
- Ensure that MacOS integration tests still work. See #3616.
- Add integration tests for MacOS in CI.
tg-login
Signing in to the Gruntwork Developer Portal from the CLI, so an admin can define a catalog in the portal alongside the one local HCL names.
tg-login - What it does
Adds the terragrunt login command, which signs you in to the Gruntwork Developer Portal using the OAuth 2.0 Device Authorization Grant (RFC 8628).
While the tg-login experiment is active, terragrunt catalog automatically discovers repositories your organization has registered in the Gruntwork Developer Portal as part of your catalog.
tg-login - How to enable it
# Via CLI flagterragrunt --experiment tg-login login
# Via environment variableexport TG_EXPERIMENT=tg-loginterragrunt loginWithout the experiment, terragrunt login is still listed in --help and refuses to run, naming the experiment it needs. terragrunt catalog stops reading the portal too, so dropping the flag returns it to the catalog block alone, whether or not a credential from an earlier login is still on disk.
tg-login - How to provide feedback
Provide your feedback in the tg-login GitHub Discussion.
tg-login - Criteria for stabilization
To transition the tg-login feature to a stable release, the following must be addressed, at a minimum:
-
terragrunt logincompletes the device flow and reports the signed-in user and organization. - On a headless or SSH session, the CLI prints the URL and code to open on another device, and login still completes.
- The CLI stores the token so it survives between commands and expires on its own.
-
terragrunt catalogbrowses and scaffolds from the portal-defined catalog as it does from a local one. - A user who is not signed in still gets a catalog from local configuration.
- A user with no catalog configured anywhere gets guidance on setting one up.
- Test coverage for login and catalog that does not need a live portal.
- Documentation for login and catalog setup.
- Completion of the private beta in the Gruntwork Developer Portal.
values-block
Support for the values block on units and stacks, which declares the values a unit or stack accepts, each with an optional type, default, description, and nullable setting.
This experiment is ongoing and disabled by default. Declaring the block without the experiment enabled returns an error. It becomes generally available once every item in the stabilization criteria below is met.
values-block - What it does
Without the block, a unit reads its terragrunt.values.hcl unchecked. terragrunt stack generate writes a misspelled key without an error, and a try() around the read of the intended key falls back to its default. With this experiment enabled, a unit declares the values it reads:
values { value "name" { type = string }
value "tags" { type = map(string) default = {} }}
inputs = { name = values.name tags = values.tags}terragrunt stack generate --experiment values-blockstack generate then rejects a key the unit doesn’t declare, such as tag for this unit’s tags, a value that doesn’t convert to its declared type, and a required value that nothing sets. It writes no terragrunt.values.hcl for the unit. When Terragrunt reads the unit, it checks terragrunt.values.hcl by the same rules, fills in defaults, and converts each value to its type. A terragrunt.stack.hcl file declares its values the same way.
terragrunt hcl validate reports each values.<name> read that the block doesn’t declare. See the values block reference.
values-block - How to provide feedback
Provide your feedback in the values-block GitHub Discussion. The design and its open questions are in the values block RFC.
values-block - Criteria for stabilization
To transition the values-block feature to a stable release, the following must be addressed:
- Decide whether a key that the
valuesblock doesn’t declare stays an error, or becomes a warning that a setting can raise to an error. - Support
validationblocks insidevalueblocks. - Decide how a unit or stack with a required value and no
terragrunt.values.hclruns, e.g. in a catalog. - Decide whether to deprecate
values.<name>reads in a config without avaluesblock. - Support the
valuesblock interragrunt-ls. - Read the declared values in
terragrunt scaffold. - Measure the cost of the check in
terragrunt stack generateon large stacks. - Decide how to handle a stale
terragrunt.values.hclleft by an earlierstack generate. - Community feedback on real-world usage.
variables-block
Support for the variables block, which sets OpenTofu/Terraform variables like the inputs attribute and also chooses how Terragrunt passes them.
This experiment is ongoing and disabled by default. A configuration with a variables block returns an error unless the experiment is enabled.
variables-block - What it does
The inputs attribute passes every value to OpenTofu/Terraform as a TF_VAR_ environment variable. When a unit has many inputs, the environment can exceed the operating system’s size limit for a new process. A single large input can also exceed the limit for one environment variable. In either case OpenTofu/Terraform fails to start with argument list too long. A variables block can write its inputs to an auto-loaded variables file.
variables { kind = "tfvar"
inputs = { vpc_id = dependency.vpc.outputs.vpc_id subnets = local.subnets }}terragrunt run --experiment variables-block -- planTo move a unit from the inputs attribute, wrap its map in a variables block. Add nullable = true if the module relies on null values from the map.
See the variables block reference for its attributes, how blocks combine, and where Terragrunt writes the variables files.
variables-block - How to provide feedback
Provide your feedback in the variables-block GitHub Discussion.
variables-block - Criteria for stabilization
To transition the variables-block feature to a stable release, the following must be addressed:
- Community feedback on real-world usage.
- Decide whether Terragrunt warns when a configuration uses the
inputsattribute.