Skip to main content
Knowledge Base

Virtual module for only applying dependencies

Answer

Hi, I'm working on a "virtual" module to apply severa dependencies (exact use case is to manage aws-auth for multiple clusters) I'm trying something like that ``` terraform { } locals { c_vars = read_terragrunt_config(find_in_parent_folders("common.hcl")) } include { path = find_in_parent_folders() } dependencies { paths = [ "${get_parent_terragrunt_dir()}/prod/eu-central-1/eks", "${get_parent_terragrunt_dir()}/prod/eu-west-1/eks", ] } dependency "eks_prod_fra" { config_path = "${get_parent_terragrunt_dir()}/prod/eu-central-1/eks" } dependency "eks_prod_irl" { config_path = "${get_parent_terragrunt_dir()}/prod/eu-west-1/eks" } inputs = {} ``` (note: dependency blocks were added out of desperations, they do not server any purpose) When running `terragrunt run-all plan --terragrunt-non-interactive` I'm only getting current module planned for execution: ``` INFO[0000] The stack at XXXinfra/tg/core/global/virtual-prod-eks-aws-auth will be processed in the following order for command plan: Group 1 - Module XXXinfra/tg/core/global/virtual-prod-eks-aws-auth Acquiring state lock. This may take a few moments... No changes. Your infrastructure matches the configuration. Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed. Releasing state lock. This may take a few moments... ``` Any idea how to force applying all dependencies? --- <ins datetime="2022-06-27T14:43:46Z"> <p><a href="https://support.gruntwork.io/hc/requests/108840">Tracked in ticket #108840</a></p> </ins>

As a safety mechanism, `terragrunt` by default ignores all external dependencies (dependencies located outside of the current folder) when using `--terragrunt-non-interactive`. If you wish to deploy external dependencies, then you need to also pass in [--terragrunt-include-external-dependencies](https://terragrunt.gruntwork.io/docs/reference/cli-options/#terragrunt-include-external-dependencies).