Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_projects does not respect Terragrunt dependency order #924

Open
ZIJ opened this issue Dec 15, 2023 · 2 comments
Open

generate_projects does not respect Terragrunt dependency order #924

ZIJ opened this issue Dec 15, 2023 · 2 comments
Labels
bug Something isn't working user-reported

Comments

@ZIJ
Copy link
Contributor

ZIJ commented Dec 15, 2023

If there are dependencies across auto-generated terragrunt projects, e.g. apps depend on VPC, then Digger does not run them in the correct order. The order of execution appears to be random or alphabetical. Likely a bug in terragrunt-atlantis-config lib that is used under the hood.

Workaround: use explicit project definition with terragrunt: true and depends_on: ["vpc", "rds"] options. Not ideal as it leads to duplication of dependency declarations.

@ZIJ ZIJ added bug Something isn't working user-reported labels Dec 15, 2023
@c-p-b
Copy link

c-p-b commented Dec 20, 2023

A good way to reproduce this is to create a simple dependency configuration that looks like this setup: https://github.com/gruntwork-io/terragrunt-infrastructure-live-example

Then tell Digger to autogenerate:

generate_projects:
  terragrunt_parsing:
    parallel: false
    createProjectName: true
    createWorkspace: true
    defaultWorkflow: default
workflows:
  default:
    plan:
      steps:
        - init
        - plan
        - run: echo "Hello World"

Then try to resolve some (nonalphabetical) projects and note that it will not resolve them according to how terragrunt specifies them in dependency DAG

@ben-of-codecraft
Copy link
Contributor

We had this reported today also, for backendless mode I think the only solutions I could think of was to all the ordering of impacted projects in digger.yml or enable a way to do run all in Terragrunt so the dependency map is built based on the dependencies block

What do you all think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user-reported
Projects
None yet
Development

No branches or pull requests

3 participants