Repository navigation
v1.2.4
#7536
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
💡 Tips Added
read-not-tracked— Points at every file read that reading filters missTerragrunt does not track a file read in a part of a config it evaluates only when it runs the unit:
inputs,generate,remote_state, the hooks andextra_argumentsofterraform, and theinputsof avariablesblock. A unit with this configuration is not selected by--filter 'reading=shared/provider.tf'or by a Git filter whenshared/provider.tfchanges:The
inputs-read-not-trackedtip pointed only at reads ininputs. The newread-not-trackedtip replaces it and points at a call to any file-reading function in any of these parts, includingmark_as_readandmark_glob_as_read:Commands that track reads, such as
run --allwith a reading or Git filter andfind --reading, print the tip.See Reading-Based Expressions. Suppress the tip with
--no-tip read-not-trackedor--no-tips.--no-tip inputs-read-not-trackedstill works and suppresses the new tip.variables-block— Points at inputs too large to pass to OpenTofu/TerraformA unit with very large
inputscan stop OpenTofu/Terraform from starting, with anargument list too longerror.With the
variables-blockexperiment enabled, Terragrunt now prints thevariables-blocktip before the run when a unit's inputs are large enough to risk this error. It points at each input over the limit and shows thevariablesblock to move it to:Suppress the tip with
--no-tip variables-blockor--no-tips.🧪 Experiments Added
commands-variable— Read the lists of commands by name with thecommandsvariableFour functions, e.g.
get_terraform_commands_that_need_vars(), each return the list of OpenTofu/Terraform commands that accept one set of flags. Enable thecommands-variableexperiment to read the lists by name:commands.accept_vars,commands.accept_locking,commands.accept_input, andcommands.accept_parallelism.The functions keep their behavior. See the
commandsvariable reference.slash-fns— Convert path separators withto_slashandfrom_slashOn Windows, the Terragrunt functions that return a path, e.g.
path_relative_to_include(), separate its parts with backslashes. Enable theslash-fnsexperiment to convert them:to_slash(path)replaces each path separator of the operating system with a forward slash, andfrom_slash(path)replaces each forward slash with the path separator of the operating system.On Linux and macOS, both functions return the path unchanged.
🧪 Experiments Updated
mcp-command— Tools write to disk only under--allow=fs-rwThe
mcpserver now reads files from disk and keeps what Terragrunt writes in memory until the tool call returns. A newfs-rwcapability lets the tools write to disk.OpenTofu/Terraform cannot see writes held in memory, so a server started without
--allow=fs-rwchanges in these ways:planis served only under both--allow=execand--allow=fs-rw, andscaffoldonly under--allow=fs-rw.fmtrefuses a call that does not setcheck.--dangerously-allow-applyis refused at startup.mock_outputs, andget_outputsreads the state itself, as both do without--allow=exec.catalogcannot clone a remote repository, and a git-range filter is refused.To keep planning, add the capability to the server's arguments:
offline-cas—run --all --cas-offlinereports every missing source at onceA
run --allwith--cas-offlineskipped the dependents of a unit whose source was missing from the store, so their own missing sources only showed up on a later run:It now looks up every source a unit would download before any unit runs, and fails with one error for each source the store cannot serve, naming the units that use it. Nothing runs until the store holds them all:
offline-cas—--cas-offlinefails on SMB sourcesA run with
--cas-offlinefetched an SMB source from its share, since SMB has no cheap probe and nothing was recorded to resolve it from. It now fails with an error naming the source:An SMB archive pinned with a literal
checksum=resolves offline from the store once an online run has stored it.To run on a host with no network, populate a store on a connected host and copy it across.
otel-logs- Records link to the correct spanEach
otel-logsrecord of a unit, including the output of its hooks, now links to a span of that unit. Records logged outside a unit link to the root command span, and a failed command exports its final error there.The log buffer now holds 32768 records. At exit, Terragrunt prints the count of records that the exporter did not confirm, e.g. records dropped from a full buffer. See OpenTelemetry.
outputs-block— Anoutputblock sets its ownmock_strategyThe
mock_strategyblock ofoutputsapplied to every output of the unit. Anoutputblock now accepts its ownmock_strategyblock. Each attribute it sets overrides the same attribute of theoutputsblock, for that output only.Before the unit is applied, a
planof a dependent reads the mock value ofvpc_idand no value foradmin_role_arn. The attributes of adependencyblock still win over both blocks. See A mock strategy for one output.outputs-block-hcl validate --outputs-mockedchecks that dependency outputs have mock valuesA
dependency.<name>.outputs.<output>reference with no mock value makesrun --all planfail before the dependency is applied. With theoutputs-blockexperiment enabled, the new--outputs-mockedflag ofterragrunt hcl validatereports each such reference:The check covers the unit, the files it includes and its
terragrunt.autoinclude.hclfile, whichstack generatewrites from theautoincludeblock of a stack unit. A reference without a mock value stays valid without the flag. See--outputs-mocked.outputs-block— Adependencyon a stack reads theoutputsblocks of its unitsA
dependencyblock that points at a stack did not read theoutputsblocks of the units in the stack, so the dependent had to setmock_outputsfor each unit. It now reads theoutputsblock of each unit the stack generates, with the same rules as for a dependency on one unit.Before the stack is applied,
dependency.networking.outputs.vpc.vpc_idresolves to themock_valuethat thevpcunit declares, for each command that themock_strategyof the unit allows. Generate the stack before you run the dependent. See With a dependency on a stack.outputs-block—hcl validate --outputschecksmock_outputskeysA
mock_outputskey for an output that the dependency does not declare passedterragrunt hcl validate --outputs, e.g. a key with a typo or a key for a removed output. The flag now reports each such key of an object that adependencyblock writes directly asmock_outputs, with anUndeclared mock outputerror.Runs do not change. A dependent still reads a
mock_outputskey that the dependency does not declare. See--outputs.values-block—scaffoldreads the declared valuesScaffolding a unit or stack that declares a
valuesblock wrote itsterragrunt.values.hclfrom thevalues.<name>reads in its configuration. A value read outsidetry()came out as"TODO", even when the block gave it a default.With the
values-blockexperiment enabled,scaffoldand the Catalog TUI now read the block. A value without a default is required. A value with a default is commented out, and Terragrunt applies the default until you uncomment it. Each entry shows its declared description and type, and so does the form:See Scaffolding units and stacks.
values-block— Validate declared values withvalidationblocksWith the
values-blockexperiment enabled, avalueblock in avaluesblock now takes one or morevalidationblocks. Each has aconditionthat reads the value asvalues.<name>, and anerror_messageto report when the condition returnsfalse:stack generatereports a value that fails, at the line of theunitorstackblock that passes it:Terragrunt runs the same checks on
terragrunt.values.hclwhen it reads the unit or stack, and checks eachdefaulttoo. See thevalidationblock reference.🐛 Bug Fixes
azurermdependency outputs are read from state with AKS workload identityWith
use_aks_workload_identityorARM_USE_AKS_WORKLOAD_IDENTITY=true, Terragrunt raninitandoutputfor every dependency.Terragrunt now reads the outputs from state. It signs in as the identity that the AKS workload identity webhook injects, as OpenTofu and Terraform do.
Bootstrapping the backend uses the same identity. Before this release, with
use_azuread_auth = true, Terragrunt tried the Azure CLI first. See Authenticating with Azure.azurermOIDC token sources match OpenTofuWith
ARM_USE_OIDC=trueand the token inARM_OIDC_TOKEN, bootstrapping anazurermbackend failed:Terragrunt now reads
oidc_tokenandARM_OIDC_TOKEN.It also uses a token or a token file before a token request URL, as OpenTofu does. With
AZURE_FEDERATED_TOKEN_FILEand a request URL both set, Terragrunt authenticates with the file.In Azure DevOps, Terragrunt requests the token for the service connection in
ado_service_connection_idorARM_ADO_PIPELINE_SERVICE_CONNECTION_ID. A service connection comes before a token and a token file. WithARM_ADO_PIPELINE_SERVICE_CONNECTION_ID, Terragrunt also reads dependency outputs from state. Before this release, it raninitandoutputfor every dependency. See Authenticating with Azure.Deep merging a
featureblock with a scalar defaultWhen a unit and a file it included with
merge_strategy = "deep"declared the samefeatureflag, and the default was a bool, number, string, or list, commands such asrun,render, andhcl validatefailed:The two defaults now merge the way one attribute of
inputsdoes under thedeepstrategy. A bool, number, or string default in the unit replaces the included one, two lists append, and two maps merge key by key. The example above runs withenable_monitoring = true.-detailed-exitcode=trueis treated like-detailed-exitcodeOpenTofu and Terraform accept
-detailed-exitcode=trueas the same flag as-detailed-exitcode, but Terragrunt recognized only the bare spelling. Aplan -detailed-exitcode=truewith changes exits 2, and Terragrunt reported that exit as a failure:Under
run --all, the unit was reportedFailedand its dependents were skipped.Terragrunt now reads
-detailed-exitcodethe way it reads-destroy: with one dash or two, from the command line or fromextra_arguments, and with a value parsed the way OpenTofu and Terraform parse boolean flags (1,t,T,TRUE,trueandTrue).run --allreturns the aggregate exit code for every true spelling.A second filter no longer removes a Git expression's boundary
A Git expression with a boundary stopped respecting it once the command had another positive filter, such as a path or a
reading=filter:Terragrunt then generated every stack in the Git worktrees, including catalog stacks outside
./live, and failed on one that readsvalues:Only filters that contain a Git expression now decide how far discovery reaches in the Git worktrees. This covers a boundary set with
--discovery-boundaryand filters read from a filters file.A filter with no Git expression still selects from the working directory as before. In a Git worktree it selects only inside the boundary.
hcl validateno longer crashes on errors that read a sensitive valueterragrunt hcl validatecrashed when it reported an error in an expression that reads a value fromsensitive():It now reports the error, and leaves the sensitive value out of it.
Pull Requests
✨ Features
mcpcommandfs-rwcapability by @yhakbar in #7451variables-blocksize tip by @yhakbar in #7453hcl validate --outputs-mockedcheck for dependency outputs by @denis256 in #7465valuesblocks inscaffoldby @yhakbar in #7464valuesvalidationblock by @yhakbar in #7468🐛 Bug Fixes
no-dot-terragrunt-cachestabilization criteria by @denis256 in #7421otel-logsstabilization criteria by @denis256 in #7429TRACEPARENTby @yhakbar in #7462-detailed-exitcode=truelike-detailed-exitcodeby @yhakbar in #7508featureblocks with scalar defaults by @yhakbar in #7509♻️ Refactors
otel-logswith aWithLogsoption by @denis256 in #7455📖 Documentation
✅ Tests
🧹 Chores
odgrimas aCODEOWNERby @yhakbar in #7436stack generatebenchmark by @yhakbar in #7456offline-cascriteria addressed by @yhakbar in #7503This discussion was created from the release v1.2.4.
All reactions