Lifecycle hooks for terraform init, and --skip-hooks now works for before-* events
Atmos now supports before.terraform.init and after.terraform.init lifecycle
hooks, and --skip-hooks is finally honored for before- hooks across plan,
apply, and deploy.
What Changed
-
New init lifecycle events. You can now run hooks around the explicit
atmos terraform initcommand:terraform:hooks:pre-init:events: [before.terraform.init]kind: commandcommand: ./scripts/check-tooling.shpost-init:events: [after.terraform.init]kind: commandcommand: ./scripts/notify-init-done.shafter.terraform.initis brand new, andbefore.terraform.init— previously listed in the docs but never dispatched to user hooks — now actually fires. -
--skip-hooksworks for before- hooks.* Previously--skip-hooksonly skippedafter.*hooks;before.terraform.plan/before.terraform.apply/before.terraform.deployhooks ran anyway. Now--skip-hooks(skip all) and--skip-hooks=name1,name2(skip by name) are honored symmetrically for both before and after events.
Why This Matters
--skip-hooks is a global flag bound to Viper inside RunE, but before-* hooks
run earlier in PreRunE — so the skip decision never saw the CLI value and
before-hooks fired regardless. The flag is now resolved directly from the parsed
command (with ATMOS_SKIP_HOOKS / config as fallback), the same way --ci and
--verbose are read, making skipping reliable everywhere hooks run.
Init hooks close a gap in the lifecycle: teams that vendor sources, validate
tooling, or notify systems around terraform init can now do it declaratively
in stack config instead of wrapping the command.
