Configuration¶
Complete reference for Cultivator runtime configuration.
Is cultivator.yml required?¶
No. Configuration file is optional.
Cultivator runs with defaults plus CLI flags and environment variables.
Using a config file¶
When using a file, pass it explicitly via --config:
Pass any YAML file path via --config. Common conventions: cultivator.yml or .cultivator.yaml.
Minimal config example¶
Full config example¶
root: live
parallelism: 4
non_interactive: true
dry_run: false
show_graph: true
changed_only: false
base_ref: main
include:
- envs/prod
exclude:
- envs/prod/experimental
tags:
- critical
plan:
destroy: false
apply:
auto_approve: false
destroy:
auto_approve: false
Precedence order¶
Highest to lowest:
- CLI flags
- Environment variables
- Config file (when passed with --config)
- Built-in defaults
Supported keys¶
root¶
- Type: String
- Default:
. - Description: Root directory used to discover
terragrunt.hclstacks
env¶
- Type: String
- Default: empty
- Description: Environment filter derived from the first directory under root
include / exclude¶
- Type: String list
- Default: empty
- Description: Relative paths under root to include or exclude
tags¶
- Type: String list
- Default: empty
- Description: Optional tags filter parsed from
terragrunt.hcltag metadata. Recommended source format is# cultivator:tags = app,db; legacycultivator_tags = ["app", "db"]remains supported.
parallelism¶
- Type: Integer
- Default: number of CPUs
- Description: Maximum number of stacks to execute in parallel
non_interactive¶
- Type: Boolean
- Default:
false - Description: Adds
-input=falseto Terragrunt commands
dry_run¶
- Type: Boolean
- Default:
false - Description: If
true, Cultivator will only log the commands it would execute without actually running them.
show_graph¶
- Type: Boolean
- Default:
false - Description: If
true, Cultivator will output a Mermaid.js dependency graph of the modules to be executed.
changed_only¶
- Type: Boolean
- Default:
false - Description: If
true, Cultivator will query Git for changed files and only execute modules affected by those changes.
base_ref¶
- Type: String
- Default:
HEAD - Description: The Git reference (branch or commit) to compare against when
changed_onlyis enabled.
plan.destroy¶
- Type: Boolean
- Default:
false - Description: Run
terragrunt plan -destroy
apply.auto_approve¶
- Type: Boolean
- Default:
false - Description: Add
-auto-approvetoterragrunt apply
destroy.auto_approve¶
- Type: Boolean
- Default:
false - Description: Add
-auto-approvetoterragrunt destroy
Environment Variables¶
Environment variables override the config file:
CULTIVATOR_ROOTCULTIVATOR_ENVCULTIVATOR_INCLUDECULTIVATOR_EXCLUDECULTIVATOR_TAGSCULTIVATOR_PARALLELISMCULTIVATOR_NON_INTERACTIVECULTIVATOR_DRY_RUNCULTIVATOR_SHOW_GRAPHCULTIVATOR_CHANGED_ONLYCULTIVATOR_BASE_REFCULTIVATOR_PLAN_DESTROYCULTIVATOR_APPLY_AUTO_APPROVECULTIVATOR_DESTROY_AUTO_APPROVE
Logging¶
CULTIVATOR_LOG_LEVEL— minimum log severity emitted by Cultivator. Accepted values:debug,info,warning,error. Default:info. Terragrunt output is always printed regardless of this setting.
Example:
export CULTIVATOR_ROOT=live
export CULTIVATOR_ENV=prod
export CULTIVATOR_NON_INTERACTIVE=true
export CULTIVATOR_LOG_LEVEL=debug # enable verbose Cultivator logs
CLI Flags¶
Flags override environment variables and config file.
cultivator plan \
--config=cultivator.yml \
--root=live \
--env=prod \
--include=envs/prod/app1 \
--exclude=envs/prod/experimental \
--tags=app,db \
--parallelism=4 \
--non-interactive
OpenTofu or Terraform¶
Cultivator runs Terragrunt, which in turn calls either OpenTofu or Terraform. Choose the binary in your terragrunt.hcl:
terraform_binary = "tofu" # Use OpenTofu
# terraform_binary = "terraform" # Use HashiCorp Terraform instead
Make sure the selected binary is installed in your CI environment.