Skip to main content
The terragrunt_parsing configuration is used within generate_projects or individual blocks to control how Digger discovers and generates projects from Terragrunt configurations.
When using Digger with Terragrunt, you can configure how projects are parsed and generated using the terragrunt_parsing key. This is available at both the generate_projects level and within individual blocks.
generate_projects:
  terragrunt: true
  terragrunt_parsing:
    autoPlan: true
    autoMerge: false
    createParentProject: false
    ignoreDependencyBlocks: false
    cascadeDependencies: true

Configuration Options

Directory and Path Options

gitRoot
string
The root directory of the git repository. Used as the base path for relative directory calculations.
outputPath
string
Path where the generated configuration will be written.
filterPaths
array
List of paths to filter when scanning for Terragrunt configurations. Only directories matching these paths will be processed.
projectHclFiles
array
List of HCL file patterns to identify as project files (e.g., ["terragrunt.hcl"]).

Project Generation Options

autoPlan
boolean
default:"false"
Automatically run digger plan when changes are detected in the project.
autoMerge
boolean
default:"false"
Automatically merge pull requests when all checks pass.
createParentProject
boolean
default:"false"
Create a parent project that encompasses child Terragrunt modules.
createWorkspace
boolean
default:"false"
Create a Terraform workspace for each generated project.
createProjectName
boolean
default:"false"
Automatically generate project names based on the directory structure.
projectAliasDelimiter
string
Delimiter used when generating project aliases from directory paths (e.g., -, _, /).
createHclProjectChilds
boolean
default:"false"
Create child projects from HCL configurations found within parent directories.
createHclProjectExternalChilds
boolean
Create child projects from external HCL configurations referenced by the parent.
useProjectMarkers
boolean
default:"false"
Use marker files to identify which directories should be treated as projects.

Dependency Options

ignoreDependencyBlocks
boolean
default:"false"
Ignore Terragrunt dependency blocks when determining project relationships.
ignoreParentTerragrunt
boolean
Ignore parent terragrunt.hcl files when parsing configurations.
cascadeDependencies
boolean
When a project is modified, also trigger dependent projects. Enables cascading changes through the dependency graph.
dependsOnOrdering
boolean
Use the depends_on ordering from Terragrunt to determine execution order.
triggerProjectsFromDirOnly
boolean
default:"false"
Only trigger projects based on directory changes, ignoring dependency relationships.

Execution Options

parallel
boolean
Enable parallel execution of independent Terragrunt projects.
executionOrderGroups
boolean
Group projects by execution order for batched processing.

Default Values

defaultTerraformVersion
string
Default Terraform version to use for generated projects.
defaultWorkflow
string
Default workflow name to assign to generated projects.
defaultApplyRequirements
array
Default apply requirements for generated projects (e.g., ["mergeable"]).
workflow_file
string
GitHub Actions workflow file to use for generated projects.

Preservation Options

preserveWorkflows
boolean
Preserve existing workflow configurations when regenerating projects.
preserveProjects
boolean
default:"false"
Preserve existing project configurations when regenerating.

AWS Configuration

aws_role_to_assume
object
Default AWS role configuration for all generated Terragrunt projects. See AWS Role Configuration.
aws_cognito_oidc
object
Default AWS Cognito OIDC configuration for all generated Terragrunt projects. See AWS Cognito OIDC Configuration.

Example Configurations

Basic Terragrunt Setup

generate_projects:
  terragrunt: true
  blocks:
    - block_name: infrastructure
      terragrunt: true
      root_dir: infrastructure
      terragrunt_parsing:
        autoPlan: true
        cascadeDependencies: true

Multi-environment Setup

generate_projects:
  terragrunt: true
  terragrunt_parsing:
    autoPlan: true
    autoMerge: false
    createParentProject: false
    ignoreDependencyBlocks: false
    cascadeDependencies: true
    defaultApplyRequirements: ["approved", "mergeable"]
    defaultWorkflow: terragrunt-workflow
    preserveProjects: true

Advanced Configuration with Filtering

generate_projects:
  terragrunt: true
  terragrunt_parsing:
    gitRoot: "."
    filterPaths:
      - "environments/production"
      - "environments/staging"
    projectHclFiles:
      - "terragrunt.hcl"
    autoPlan: true
    cascadeDependencies: true
    dependsOnOrdering: true
    parallel: true
    executionOrderGroups: true
    createProjectName: true
    projectAliasDelimiter: "-"

See Also