Skip to content

Exclude block in a single unit implicitly ignoring shared dependencies of all other units in a queue. #5096

@nuryupin-kr

Description

@nuryupin-kr

Describe the bug

exclude {
  if = true
  actions  = ["all"]
  exclude_dependencies = true # <- ⚠️ This also ignores dependencies, shared with other units in the queue
}

Reproducing bugs

  1. Run terragrunt run-all plan

  2. Produces following groups due to dependencies between units:

Group 1:
apple
watermelon

Group 2:
cucumber (depends on apple)

Group 3:
potato (depends on apple and cucumber)
tomato (depends on apple and cucumber)
peach (depends on apple and cucumber)
banana (depends on apple, watermelon and cucumber)

  1. Now lets say I add exclude block to banana unit as follows:
exclude {
  if = true
  actions  = ["all"]
  exclude_dependencies = true
}
  1. Now when I run terragrunt run-all plan I see following result:

Group 1:
potato
tomato
peach

exclude_dependencies = true in the exclude block of the banana unit, effectively excluding same dependencies (apple, cucumber) that are shared by sibling units (potato, tomato, peach).

Expected behavior

Group 1:
apple

Group 2:
cucumber (depends on apple)

Group 3:
potato (depends on apple and cucumber)
tomato (depends on apple and cucumber)
peach (depends on apple and cucumber)

I would expect that other units in queue that share same dependencies with banana, would still have their dependencies included despite exclude_dependencies = true being specified in banana unit.

I would expect exclude_dependencies = true to apply to only those dependencies that are exclusive to that particular unit (in this case only watermelon is an exclusive dependency of banana).

Versions

terragrunt version v0.73.14
terraform version 1.5.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions