cloudtools / cloudtools/stacker
Make hooks a part of the dependency graph.
- Dominant language
- Python
- Stars
- 707
- Forks
- 162
- PR merge metrics
- No merged PRs in 30d
Description
At the moment, the lifecycle around hooks are pretty basic:
1. `pre_build` runs before stacker does anything to stacks
2. `post_build` runs after stack does everything to stacks
It would be nice if hooks were just a part of the dependency graph, like stacks are, so that you can reference outputs from hooks, and use them as inputs to stacks and vice/versa.
For example:
```yaml
hooks:
- name: "ecsCluster"
class_path: stacker.hooks.ecs.create_clusters
args:
clusters:
- "staging"
stacks:
- name: "app"
class_path: blueprints.App
variables:
ECSCluster: ${hook_data ecsCluster::ClusterName}
```
Instead of stacker executing the hooks in a separate step, stacker would just execute the hooks as it walks the dependency graph (`app` depends on `ecsCluster`).
I'm not even sure if "hooks" would be the right name for this if it was supported, since it'd be more like a pseudo/virtual stack.
Contributor guide
Assessment
This issue has not been assessed yet.