cloudtools / stacker

An AWS CloudFormation Stack orchestrator/manager.
http://stacker.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
709 stars 167 forks source link

Locked stacks have no dependencies #661

Closed ejholmes closed 6 years ago

ejholmes commented 6 years ago

This is a performance optimization when using the --stacks/--targets flag, and extracted from https://github.com/cloudtools/stacker/pull/632.

Think of the following example

stacks:
  - name: a
    locked: true
  - name: b
    requires: [a]
    locked: true
  - name: c
    requires: [b]

This forms a dependency graph like so:

c -> b -> a

Given I run stacker build --targets c, stacker will walk all 3 nodes in the graph, however, given that b is locked, it's unnecessary for stacker to execute a; since b is locked it doesn't need any information from a, and thus, doesn't actually depend on a.

With this change, because b is locked, it has no dependencies, so a will not be included in the filtered graph, which becomes:

c -> b