Skip to main content
Knowledge Base

How can we override dependency block in Terragrunt ?

Answer

Hello guys, I have a scenario where i have to create same resource two times (e.g rabbitmq) using terragrunt. Folder structure is like below ``` └── live ├── terragrunt.hcl ├── _env │ ├── rabbitmq.hcl │ └── vpc.hcl ├── stage │ ├── env.hcl │ ├── rabbitmq │ │ └── terragrunt.hcl │ └── vpc │ └── terragrunt.hcl └── qa ├── env.hcl ├── rabbitmq └── terragrunt.hcl ``` - Stage rabbitmq has a dependency on stage vpc. - The qa rabbitmq has a dependency on the the stage vpc. - In _env/rabbitmq.hcl file, i have given config path: ``` dependency "vpc" { mock_outputs_allowed_terraform_commands = ["plan", "validate"] config_path = "${get_terragrunt_dir()}/../vpc" } ``` When I try to overwrite the dependency block in qa/rabbitmq/terragrunt.hcl file with ``` config_path = "${get_terragrunt_dir()}/../stage/vpc" ``` its not working. how can I achieve it ?

Hello! Can you please also share the rest of your `qa/rabbitmq/terragrunt.hcl` and `qa/env.hcl` files?