Terragrunt
Terragrunt is a thin wrapper that provides extra tools for keeping your configurations “Don’t Repeat Yourself” (DRY), working with multiple Terraform modules, and managing remote states.
Run-all Terragrunt command checkbox
Within Terragrunt template configuration, under Advanced
settings - check Execute run-all commands on multiple modules
- Adds
run-all
to each command, read more here. - Supported from version 0.28.1.
Local Terraform State
By default, env0 stores the local state for next deployments.
In some cases, we will not be able to store the local state for your Terragrunt modules. Please configure a remote backend with your Terragrunt code Remote terraform code, otherwise your Terragrunt code may not work properly with env0.
Cross-Module Dependencies
env0's Terraform deployment flow includes a
plan
step and anapply
step that uses the plan's results (plan file/s) to ensure every change is aligned between both steps.According to the official docs, the
run-all plan -out=/path/to/plan-file
command we use will fail if there are yet-to-be-applied dependencies between modules. It will only output some of the expected plan files. This leads to the failure of therun-all apply /path/to/plan-file
command that is being executed next, since it expects all modules to have plan files.As a workaround, we expose the
ENV0_OMIT_TERRAGRUNT_RUN_ALL_PLAN_FILE
environment variable. Simply set it's value totrue
and deploy. Therun-all plan
andrun-all apply
commands will be executed without passing plan files between them. This is risky and should only be done on initial deployment. On success, it is advised to remove this environment variable in order to keep theplan
andapply
steps in-sync.
Suggested Blog Content

Updated 19 days ago