Looking for module dependency checking tool

Hello,

I’m looking for a Terraform module dependency checking tool to be used in CI/CD implementation to apply changes.

Assume I have a setup with multiple code repositories:

Repository ‘main’:

env_a:

main.tf
env_b:

main.tf

Which contains main.tf which source modules from another repo ‘modules’:

Repo ‘modules’:

module_1:

main.tf
variables.tf

module_2:

main.tf
variables.tf

I want to be a able to trigger a workflow when module_1 or module_2 had code changes which require to run Terraform on env_1 or env_2. In other words, I want to be able to detect the dependency between Terraform modules and callers, so I can apply changes correctly.

I know how to implement such logic by myself, but wondered if there’s a ready tool which allows you to do so.

Appreciate your help.

Thanks,
Zeffy

The way we handle this is by ensuring all Terraform module references are versioned (i.e. referencing a specific tag/version) and then use Renovate Bot to keep those up to date. We don’t want to just always use the latest version without any choice, as there might be breaking changes or other dependencies we have to handle.