dependency blocks in terragrunt.hcl. Pulumi solves it with StackReference objects you wire up manually. ubx solves it by reading your .iac source: the moment you write @networking.vpc_id in the cluster stack, ubx knows the networking stack must be planned and applied before the cluster stack can run. No orchestration file. No manual ordering. The dependency graph is derived from the references you already have to write anyway.
What you’ll learn
- How
@name.outputcross-stack references trigger automatic dependency resolution - How ubx discovers sibling stacks by name within the same repository
- The plan output showing stack-boundary headers and dependency labels
- How already-applied upstream stacks are skipped during
ubx apply - The
--no-depsflag to opt out of automatic resolution - The
--allflag to plan or apply every stack in the workspace
Why this matters
@name.output resolves to a Pulumi StackReference.getOutput() call in generated code. ubx reads the reference at compile time to build the dependency graph — no separate config file, no depends_on in a YAML manifest.The source code
How it works
@name.output is the only config you need
Writing
@networking.vpc_id in the cluster stack is the complete declaration of the dependency. ubx parses this at compile time, identifies networking as the name of a sibling stack directory, and adds it to the dependency graph. There is no separate orchestration file to maintain.ubx resolves the graph before planning or applying
When you run
ubx plan --env dev in the cluster directory, ubx first prints the resolved graph, then plans each stack in order — networking first as a dependency, cluster second as the target. Each stack gets its own ━━━-bounded section in the output with a (N/M — role) label.Already-applied stacks are skipped
During
ubx apply, ubx checks whether each upstream stack has already been applied and has no pending changes. If networking is up-to-date, its section shows ● networking/ up-to-date and ubx moves straight to applying the cluster stack. Re-applying a dependency stack unnecessarily is never the default.Plan output
Runningubx plan --env dev from the cluster directory:
Apply output
Runningubx apply --all --env dev from the repository root:
What ubx generates
Common mistakes
Run it
What you learned
@name.output cross-stack references are the complete declaration of a stack dependency — no orchestration file neededubx resolves the dependency graph at compile time and plans/applies stacks in topological order automatically
Already-applied upstream stacks with no changes are detected and skipped during
ubx apply--no-deps opts out of automatic resolution for CI pipelines with explicit per-stack job orderingNext steps
remote — cross-repo references
Reference outputs from stacks in other repositories
interface contract validation
Enforce typed output contracts on stacks
Full runnable example: github.com/ubiquex/ubx-examples/59-multi-stack-dependency-resolution

