Skip to main content

Gruntwork Provided Hooks

info

Hooks are an Enterprise-only feature.

Gruntwork-provided hooks are ready-to-use extensions of a Pipelines run, built and maintained by Gruntwork. They require pipelines-workflows v4.24.0 or later on GitHub, or v2.19.0 or later on GitLab.

repository {
after_hook "infracost_estimate" {
name = "Infracost Estimate"
commands = ["plan"]
execute = ["pipelines", "hook", "infracost@v0"]
}
}

Gruntwork-provided hooks are executed by running pipelines with the hook's name and version as shown above.

Available hooks

  • Infracost - shows what a change costs before it is applied, per unit and in total.

More are in development and will appear here as they are released.

Configuration

Choosing a version

A hook is referenced as <name>@<version>. Hooks are versioned independently of Pipelines. Pin the reference as tightly or as loosely as you want new releases to be automatically used.

ReferenceResolves toUse when
infracost@v0the latest v0.x.xyou want fixes and new features
infracost@v0.5the latest v0.5.xyou only want patches
infracost@v0.5.0this specific releaseyou want fixed versions

Environment variables

The pipelines hook command accepts the hook reference and nothing else, so a hook reads its configuration from environment variables. Set them in the hook block's env declaration:

repository {
after_hook "infracost_estimate" {
# ...

env {
PIPELINES_HOOK_INFRACOST_CLI_VERSION = "0.10.45"
}
}
}