terragrunt 1.0.8#287357
Merged
Merged
Conversation
botantony
approved these changes
Jun 10, 2026
Contributor
|
🤖 An automated task has requested bottles to be published to this PR. Caution Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created by
brew bumpCreated with
brew bump-formula-pr.Details
release notes
TG_CTX_HOOK_TYPE—before_hook,after_hook, orerror_hook, identifying which lifecycle phase invoked the hook.TG_CTX_SOURCE— the resolved terraform source URL (CLI--sourceoverride, else evaluatedterraform.sourcewith source-map applied, else.).TG_CTX_TERRAGRUNT_DIR— the directory of the current Terragrunt config.These variables make it easier to share a single hook script across lifecycle phases and to access the unit's source and config directory without threading them through hook arguments.
🧪 Experiments Updated
cas: fallbacks now emit telemetryWhen the
casexperiment is enabled and a CAS operation cannot complete, Terragrunt falls back to a slower path (the standard download client, or a temporary clone when the shared git store is unavailable) and keeps going. Until now the only record of a fallback was a warning in the logs, which made it impractical to measure how often CAS degrades across a fleet.Each fallback now also emits a
cas_fallbacktelemetry event whosereasonattribute identifies the cause:init_error,getter_error,git_store_unavailable,probe_failure, orstack_generation_error. Operators collecting OpenTelemetry traces or metrics from Terragrunt can count and alert on these events to judge CAS health before relying on it by default.CAS flags for the
catalogcommandThe
catalogcommand now accepts the--no-casand--cas-clone-depthflags, which were already available onrun,stack generate, andstack run. When--no-casis set, catalog repositories are cloned with plain Git even if thecasexperiment is enabled.--cas-clone-depthcontrols thegit clone --depthvalue the CAS uses when cloning catalog repositories.cas—update_source_with_casrequires a literal source stringWhen a catalog
unit,stack, orterraformblock setupdate_source_with_cas = truewith asourcethat was not a literal string, rewriting silently produced a wrong source. Interpolation such as"../units/${local.name}"had the interpolated portion dropped, leaving a bare prefix; a reference such aslocal.fooresolved to the directory containing the block itself. In both cases stack generation packaged the wrong directory without any error.Stack generation now fails with an error explaining that
update_source_with_casrequires a literal source string. Non-literal expressions, including interpolation, function calls, and references likelocal.foo, are rejected.cas— Malformedcas::references fail with a clear errorA
cas::source with a malformed hash, such ascas::sha1:a, used to fail with an opaque internal error while looking the hash up in the store.CAS references are now validated up front: the hash must be lowercase hexadecimal with exactly 40 characters for
sha1or 64 forsha256. References that don't match are rejected with an error identifying the bad reference.cas— Repositories with submodules now clone correctlyCloning a repository that contains git submodules through the Content Addressable Store failed while ingesting the repository:
A submodule appears in the repository tree as a pointer to a commit in another repository, so the object behind it cannot be read from the repository being cloned.
The CAS now fetches each submodule from the URL registered in
.gitmodulesat its pinned commit and materializes its contents in place, including nested submodules. Relative submodule URLs (such as../sibling.git) are resolved against the parent repository URL, matching git's behavior. Submodule contents are stored and deduplicated like any other content, so repeated clones reuse the cache.catalog-redesign— Failures now exit nonzero and name the sources that failedThe redesigned catalog exited with code 0 even when it failed: a session that ended on an unreachable repository, a failed scaffold, or a failed copy reported success in its exit code. Repositories that failed to load during discovery were dropped too: the warning logged for each one was drawn over by the full-screen interface, so a run where every source failed showed the same "No catalog sources were discovered" screen as a run that genuinely found nothing.
The catalog now exits nonzero when the session ends on a failure: a discovery failure that leaves nothing to browse, a failed scaffold, or a failed copy. Quitting a working session still exits 0. When some sources fail to load while others succeed, the catalog stays usable and a clean quit still exits 0; the component list shows how many sources failed, and the failed repositories are printed with their causes after the catalog closes. When every source fails, the error screen lists each failed repository instead of claiming nothing was found, and dismissing it exits nonzero.
Running
terragrunt catalogwithout an interactive terminal, such as in CI, used to fail with a raw error from the underlying TUI library:It now fails immediately with an error stating that the catalog command requires an interactive terminal.
catalog-redesign— Scaffolding a component no longer fails with a path-traversal errorScaffolding a component from the catalog (pressing
s) could fail on macOS while downloading the source:The catalog caches each repository under the system temporary directory, which macOS reports through a symlink (
/var/folders/...pointing at/private/var/folders/...). The source location Terragrunt handed to the downloader was built against the unresolved path, so it pointed outside the cached repository and was rejected.Terragrunt now resolves the temporary directory before discovering components, so the source stays inside the repository and scaffolding proceeds.
stack-dependencies: HCL tooling now handlesautoincludeTwo tooling gaps around the experimental
autoincludeblock are closed:hcl validatenow validatesautoincludeblocks. With thestack-dependenciesexperiment enabled, validating aterragrunt.stack.hclthat declaresautoincluderuns the same strict checks asterragrunt stack generate. A malformed block (for example, alocalsblock insideautoinclude) is now reported at validation time instead of passinghcl validateand only failing later during generation. Without the experiment, validation behavior is unchanged.read_terragrunt_config()can read stack-level autoinclude files. Reading a generatedterragrunt.autoinclude.stack.hclpreviously failed because the file was decoded as a unit configuration, which rejects itsunitandstackblocks. With the experiment enabled, the file is now decoded as the stack-file fragment it is, returning itsunitandstackblocks the same way reading aterragrunt.stack.hcldoes. Unit-levelterragrunt.autoinclude.hclfiles already read correctly and continue to do so.stack-dependencies:autoincludemerges like a regular includeA generated unit autoinclude (
terragrunt.autoinclude.hcl) now merges into the unit's config using the same default merge as a regularinclude, which is a shallow merge, applied uniformly across generation, full parse, and discovery. Top-level keys from the unit and the autoinclude combine, and on a conflict the autoinclude wins and replaces the unit's value rather than deep-merging nested maps;localsstay local in scope.A generated stack autoinclude (
terragrunt.autoinclude.stack.hcl) injectsunitandstackblocks into the generatedterragrunt.stack.hcl. An injected block whose name matches an existingunitorstacknow overrides that block wholesale, consistent with unit autoinclude override semantics, and an injected block with a new name is added. This applies uniformly across generation, full parse, and discovery, so a name match no longer produces a duplicate-name error. A stack autoinclude may not declare a top-leveldependencyblock (stacks have no dependencies; declare the dependency inside the target unit's own autoinclude).A
dependencyblock injected through anautoincludeis now available before a unit'sremote_stateis evaluated, so referencingdependency.<name>.outputs.<key>there no longer fails.remote_statenow behaves the same asgenerateblocks.stack-dependencies:autoincludeblocks can referencevalues.*An
autoincludeblock may now reference the stack'svalues.*. Previously avalues.*reference was rejected at stack generate time, except in a dependencyconfig_path. It now resolves to a literal likelocal.*,unit.<name>.path, andstack.<name>.path, wherever it appears:inputs,generate,remote_state,mock_outputs, andconfig_path.Function calls in an autoinclude now resolve at generate time too, in the
terragrunt.stack.hclcontext, instead of being kept verbatim and evaluated in the generated unit. Only adependency.*reference (a dependency's outputs) stays verbatim and resolves inside the unit; in a mixed expression the stack-level parts resolve and only thedependency.*reference is kept.Because functions now evaluate against the stack file rather than the unit, directory and include functions report the stack file's location:
get_terragrunt_dirreturns the stack file's directory, andpath_relative_to_includereturns".". If you relied on these resolving in the unit, move them to the unit's own configuration, or derive a per-unit value such as aremote_statebackend key fromunit.<name>.path.A
localsblock inside an autoinclude remains rejected; declare stack-level locals interragrunt.stack.hclinstead.stack-dependencies: stack dependencies resolvevalues.*in the target stack's localsExpanding a dependency that points at a generated stack directory no longer fails when that stack's
terragrunt.stack.hclreadsvalues.*in itslocalsblock. Previously,terragrunt stack generatesucceeded butterragrunt run --allthen failed withThere is no variable named "values"while expanding the dependency into its units.Dependency expansion now reads the generated
terragrunt.values.hclnext to eachterragrunt.stack.hclit visits, including nested stacks, so each nesting level resolvesvalues.*from its own values file, the same way a full stack parse does.stack-dependencies: component path references invaluesno longer break next toautoincludeblocksA
unitorstackblock'svaluescan referenceunit.<name>.pathandstack.<name>.patheven when another block in the sameterragrunt.stack.hcldeclares anautoinclude. Previously, the presence of anyautoincludeblock madestack generatereject those references withUnknown variable; There is no variable named "unit", while the same file without anautoincludegenerated fine.Pull Requests
✨ Features
🐛 Bug Fixes
OTEL_SERVICE_NAMEandOTEL_RESOURCE_ATTRIBUTESenvironment variables by @Tensho in #6256terragrunt.stack.hclfiles by @yhakbar in #6291autoincludeinhcl validateand fixread_terragrunt_config()for configurations usingautoincludeby @yhakbar in #6297📖 Documentation
completedSinceby @yhakbar in #6252.mdchangelog files by @yhakbar in #6286autoincludedocumentation by @yhakbar in #6299🧹 Chores
autoincludemore flexible, supportingvalues.*by @yhakbar in #6283--no-casflag to thecatalogcommand by @yhakbar in #6292📝 Other Changes
View the full release notes at https://github.com/gruntwork-io/terragrunt/releases/tag/v1.0.8.