Multi-unit delivery and failure handling
Review the resolved target set
A directory name, filter expression or requested list is not the final authority for a multi-unit operation. Inspect the discovered queue, sources, dependencies, backend identities and actual credentials boundary. A dependency graph can expand beyond the intended folder; configuration evaluation may read additional files or execute reviewed hooks. Compare the resolved inventory to an approved allowlist.
Request: dev/appApproved: dev/app, dev/networkResolved: dev/app, dev/network, prod/networkDecision: HOLD (unexpected prod/network)A filter is useful for selecting units but is not an access-control policy. Use separate credentials and state permissions to enforce scope. See https://docs.terragrunt.com/features/stacks/run-queue/ and https://docs.terragrunt.com/features/filter/.
Separate queue inspection from execution
These commands are documentation-based illustrations only, not instructions to execute in an unknown directory. The approved pinned wrapper must be checked before using them.
terragrunt find --as planterragrunt run --all --filter './dev/**' --parallelism 2 -- planA stack operation can generate configuration before running it. Review generated files, catalog revisions and any filter file before executing. The parallelism option here limits simultaneous unit runs, not the number of resources the underlying engine can process within each unit. Choose bounds using runner capacity, provider limits and backend contention. Never use broad recursive apply as the approval mechanism; documented multi-unit apply/destroy can automatically approve underlying operations. See https://docs.terragrunt.com/reference/cli/commands/find/.
Partial success is not a rollback
Imagine dev/network applies successfully and emits a new label. The app apply fails after a provider reports an error, and logging succeeds independently. The whole operation is not atomic; the upstream changes and any successful app changes may persist.
network: SUCCESS (new output recorded)app: FAILED (possible partial state changes)logging: SUCCESSreport: PARTIAL; pause dependent deliveryDo not rerun every unit or blindly restore old state. Stop new writes, identify the actual state and resource changes, examine redacted diagnostics and establish lock ownership. A failed operation does not guarantee no change. Generate new plans for affected units from their reconciled state, and reassess downstream outputs. An old saved plan is not a reliable retry after inputs, state or dependencies change.
Decide what can be retried
For the app, confirm that network is stable, real outputs are present, current state was reconciled, source and identity remain approved and a new plan is reviewed. If a rollback is warranted, evaluate it as a new scoped change with explicit impact on consumers and persistent data.
Network output changed -> invalidate consumer approvalApp state uncertain -> HOLDReconciled app + reviewed new plan -> ELIGIBLE_FOR_REVIEWA retry can have different consequences from the original operation. A mock value may help a permitted static validation but cannot stand in for a live output during deployment. Do not bypass a lock or dependency failure to continue a delivery.
Compare orchestration boundaries
Separate Terraform root modules can be coordinated manually or through CI; Terragrunt adds configuration reuse and a unit queue. HCP Terraform Stacks use a distinct configuration and hosted orchestration model. CI may add identity, approvals, audit and artifact retention around either approach. None should be assumed to provide atomic cross-state rollback. Choose the simplest mechanism that meets required coordination, audit, isolation and operational recovery needs. Separate platform-specific syntax and licensing from transferable dependency reasoning.
Practice with an offline queue
The supplied JSON scenarios and Python checker evaluate a small fictional graph, resolved target sets and recovery gates. They do not parse HCL, discover real resources or implement Terragrunt scheduling.
Expected outcomesComplete approved acyclic queue -> ELIGIBLE_FOR_REVIEWCycle or unknown dependency -> HOLDUnexpected target or failed upstream -> HOLDChanged upstream with stale consumer plan -> HOLDAn eligible result is not deployment authorization. Use the worksheet to explain the required evidence and why independent successes remain in place. Next: state recovery, backend migration and disaster recovery.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Multi-unit delivery and failure handling — knowledge check
Review stack generation, dependency ordering and recovery.
An extra production unit appears in the resolved queue. What should happen?
What does a wrapper parallelism cap control?
Network succeeds but app fails. What is the correct assumption?
When should a consumer plan be refreshed?
What does the offline queue model prove?