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

  • AI Summary - Summarize the terragrunt run's plan output with an AI model
  • Infracost - Get estimated costs for your infrastructure
  • Trivy - Scan each unit's plan for misconfigurations with Trivy

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.6the latest v0.6.xyou only want patches
infracost@v0.6.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"
}
}
}