You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be swell if there was some way, either when running init/plan/apply or any other validation command, if Terragrunt warned about unused dependency blocks.
RFC Not Needed
I have evaluated the complexity of this enhancement, and I believe it does not require an RFC.
The text was updated successfully, but these errors were encountered:
How would you define an unused dependency? If none of its outputs are used? Personally, I sometimes use (explicit) dependency blocks w/o outputs and I wouldn't need to be reminded of that 😅
How would you define an unused dependency? If none of its outputs are used? Personally, I sometimes use (explicit) dependency blocks w/o outputs and I wouldn't need to be reminded of that 😅
Interesting. What's the use-case for a dependency block that's not used? 🤔
Regardless, that's probably and edge case that could be solved with a "don't warn"-attribute in the block.
To answer your question, your use-case not withstanding, if there's a dependency block defined - but not called, a warning is issued.
Meaning, if we have:
dependency"foo" {
}
But no calls to dependency.foo, it warrants a warning.
Defining a dependency without using any outputs gives Terragrunt information on its relationship in the DAG.
It's useful, even though someone could theoretically do the same thing via a dependencies block, which can't define outputs.
I think what would be more useful here is some type of lint that can warn on that for users trying to discover dependencies without used outputs.
We don't have a dedicated Terragrunt linter right now, but we will have an hcl lint command after the CLI Redesign. It might be a good feature to add there.
Describe the enhancement
It'd be swell if there was some way, either when running init/plan/apply or any other validation command, if Terragrunt warned about unused
dependency
blocks.RFC Not Needed
The text was updated successfully, but these errors were encountered: