Terraform stack dependencies: a graph of stacks, modules and repositories
Stackorder scans your repository for stacks: directories under stacks/**, or the globs you set in stacks.discover, that contain a backend "s3" block. It builds a graph from three kinds of edge. A change plans every stack it reaches, and applies follow the graph.
depends_on- Declared in a stack's
.stackorder.yaml. It orders the run and propagates changes, and it can name a stack in another repository. uses_module- Parsed from
modulesources, through nested local modules, so a change to a local module plans every stack that uses it. reads_state- Inferred from a
terraform_remote_statedata source whose bucket and key match another stack's backend. Promote it withdepends_onor suppress it withignore_inferred.
stackorder graph
9 stacks, 3 modules, 8 edges
infra/kyc:production
infra/kyc:staging
infra/registry:shared
depends_on infra/kyc:production
stacks/legacy/dns
stacks/prod/apps
reads_state stacks/prod/vpc (inferred)
stacks/prod/eks
depends_on stacks/prod/vpc
uses_module stackorder/example-infra//modules/eks
stacks/prod/vpc
uses_module stackorder/example-infra//modules/vpc
stacks/staging/apps
depends_on stacks/staging/vpc
stacks/staging/vpc
uses_module stackorder/example-infra//modules/vpc
stackorder/example-infra//modules/common (local module)
stackorder/example-infra//modules/eks (local module)
uses_module stackorder/example-infra//modules/common
stackorder/example-infra//modules/vpc (local module)
warning: stacks/legacy/dns: inferred reads_state edge to stacks/prod/vpc suppressed by ignore_inferredstackorder graph on stackorder/example-infra, with the CLI from the 0.1.0 release. It also prints DOT and JSON.



