Skip to content

Hooks

Hooks run commands around component lifecycle phases.

hooks:
pre_apply:
- command: ./prepare.sh
post_apply:
- command: curl -fsS "${api.outputs.url}/health"

Hook phases:

  • pre_apply
  • post_apply
  • pre_destroy
  • post_destroy

Each hook supports:

FieldRequiredDefaultDescription
commandYesNoneCommand string. Values are interpolatable.
shellNo["sh", "-c"]Shell command prefix used for the hook.
envNo{}Additional hook environment values. Values are interpolatable.

Hooks require the selected runner to support Exec. See Lifecycle Hooks for behavior details.

See Env for default runtime variables available to hooks.