cloudtools / cloudtools/stacker

Make hooks a part of the dependency graph.

Open
#461 2 comments 4 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.