Skip to content

terragrunt blocks does not take into account external modules folder #1631

Open
@motatoes

Description

@motatoes

consider this folder structure:

├── digger.yml
└── tf
    ├── env
    │   ├── common_vars.hcl
    │   ├── sandbox1
    │   │   ├── account_vars.hcl
    │   │   ├── environment_vars.hcl
    │   │   └── paris
    │   │       ├── region_vars.hcl
    │   │       └── s3
    │   │           └── terragrunt.hcl
    └── modules
        ├── README.md
        └── s3
            ├── README.md
            └── main.tf

and a digger.yml as follows:

generate_projects:
  blocks:
    - block_name: sandbox1
      terragrunt: true
      root_dir: "./tf/env/sandbox1/"
      include_patterns: [ "./tf/modules/**"]
      workflow: default
      workflow_file: digger_workflow.yml
    - block_name: sandbox2
      terragrunt: true
      root_dir: "./tf/env/sandbox2/"
      include_patterns: [ "./tf/modules/**"]
      workflow: default
      workflow_file: digger_workflow.yml

In this case making a PR which chaneges tf/modules/s3/main.tf should trigger changes to impacted terragrunt projects in tf/env/** directories, however it does not cause them to trigger because block search are scoped to the directory itself. We need to start supporting include/exclude for blocks in order to make digger also search blocks based on changes outside of the block scope ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions