Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make hooks a part of the dependency graph. #461

@ejholmes

Description

@ejholmes

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions