Skip to content

dependencies

unit

Usage

The dependencies block orders units in a run queue. To also read a unit’s outputs, use a dependency block, which orders the run the same way.

live/app/terragrunt.hcl
dependencies {
paths = ["../vpc", "../rds"]
}
  • Directorylive
    • Directoryvpc
      • terragrunt.hcl
    • Directoryrds
      • terragrunt.hcl
    • Directoryapp
      • terragrunt.hcl

Running terragrunt run --all -- apply in live applies vpc and rds concurrently, then app:

Diagram

terragrunt run --all -- destroy runs in the reverse order: app first, then vpc and rds.

A configuration file can have one dependencies block. When a unit includes a file with its own dependencies block, the unit depends on the paths from both.

Attributes

pathslist(string)

Paths to the units this unit depends on. Relative paths resolve against the unit’s directory, even in a file the unit includes. A path to a stack directory adds every unit the stack generates. See Depending on a stack.

terragrunt.hcl
dependencies {
paths = ["../vpc", "../rds"]
}