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

Support Terragrunt dependencies between projects #402

Open
ZIJ opened this issue Jun 22, 2023 · 2 comments
Open

Support Terragrunt dependencies between projects #402

ZIJ opened this issue Jun 22, 2023 · 2 comments

Comments

@ZIJ
Copy link
Contributor

ZIJ commented Jun 22, 2023

Raised by Bastien: regarding terragrunt, I think you don't have the concept of dependencies yet. Right now I'm parsing hcl files to generate digger.yml with the correct include_patterns . Is there a way to make sure plan/apply are made in the correct order ?

Igor: indeed no dependencies support yet (...) there are similar concepts in Spacelift and the likes (...)
it looks like there could be somewhat different use cases for dependencies:

  1. the include_patterns workaround solving for project A apply being triggered whenever changes are made to an outside directory, like modules
  2. "soft" dependencies between projects - smth like this: whenever apply for BOTH project A and B are triggered, A always runs before B. Not preventing isolated runs of either A or B though.
  3. "hard" dependencies between projects - whenever apply B is triggered, apply A must run first (even if no changes to A were made)

Bastien: 2 should be enough to support terragrunt dependencies

@ZIJ
Copy link
Contributor Author

ZIJ commented Jun 23, 2023

Additional input from Bastien:

(Bastien): Even if it's "usable" it's something that we need if we want to use it in production. Terragrunt will fail if a dependency needs to be applied. In this case we need to (manually) make sure project A is applied before B. So for if we touch a project (e.g VPC) which many projects depends on, it becomes difficult to manage, it's way easier to just run terragrunt run-all apply rather than digger apply -p for every project (and I'm not even mentioning dependencies of dependencies :rolling_on_the_floor_laughing: )

Q (Igor): with dependency feature in place (we're thinking a standard dependency graph flattening logic), would you want to still run the terragrunt binary for each project, or terraform? or both (differently for different projects)?

A (Bastien): terragrunt, still need it to load common config/etc.

@ZIJ
Copy link
Contributor Author

ZIJ commented Dec 21, 2023

Related to #924 and #791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant