Using the Wiz Plugin with Terragrunt Stacks in Spacelift

Last updated: September 23, 2026

The Wiz Plugin for Spacelift expects the plan file (spacelift.plan) to be located in the project root. However, Terragrunt stores plan files inside the .terragrunt-cache/ directory, which causes the Wiz Plugin to skip plan export on affected stacks.

Solution: Custom Plugin Template

The recommended approach — especially for complex setups such as stacks using Terragrunt's run-all feature (which produces multiple plans) — is to use the available custom plugin template provided by Spacelift. You can copy the template and create your own custom plugin:

Quick Fix: Single Plan Stacks

For simpler Terragrunt stacks that produce a single plan, you can add an after_plan hook that runs before the Wiz Plugin's own hook. This hook locates the plan file inside the Terragrunt cache and copies it to the expected location:

SRC_DIR="/mnt/workspace/source/${TF_VAR_spacelift_project_root}"
PLAN=$(find "$SRC_DIR" \( -name 'spacelift.plan' -o -name 'Spacelift.plan' \) -exec ls -t {} + | head -n1)
cp "$PLAN" "$SRC_DIR/spacelift.plan"

For more details on plan file resolution, see the related article: Spacelift Plan Not Found.

Note: The quick fix above is best suited for stacks with a single plan. If you are using Terragrunt's run-all feature, which generates multiple plans, the custom plugin approach is strongly recommended instead.