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
Sometimes, I am testing local changes to the eks module, and I want to use a local version of the source code to avoid committing changes to a branch to test it.
Both repositories are cloned locally on ~/git folder.
When I do:
cd eks
terragrunt plan --terragrunt-source ~/git/terraform-aws-eks-module
I get:
[terragrunt] 2020/09/17 14:30:54 Did not find any Terraform files (*.tf) in ~/git/terragrunt-project/vpc/.terragrunt-cache/x8mfE_ZvAC1E31uXzInOVIdKsfs/sfAihJo8SRsjA8pstYtGUtBaKmE/terraform-aws-vpc-module
That's because, vpc is a dependency of eks, and that module is not found on ~/git/terraform-aws-eks-module.
I understand usually Terragrunt uses the same "live" repository for all source attributes, so then all modules are on the same repository. If that was the case there would be no problem as it would find both modules on the same place.
I wonder if it is not possible to still be able to use --terragrunt-source on this use case I have.
I see a few options:
Another flag to disallow looking at dependencies with --terragrunt-source, something like:
terragrunt plan --terragrunt-source ~/git/terraform-aws-eks-module --terragrunt-source-no-dependencies
Maybe on the dependency block we could say if we want to participate on --terragrunt-source:
Terragrunt could automatically ignore dependencies for --terragrunt-source if they are coming from different Git repos than the module we are running. So it would work correctly with "live" single repositories by changing the source on all modules, while still avoiding this if the repositories are not the same. Possibly this logic can be tricky but definitely the one with less user configuration.
For now, my workaround is to comment the files while I am doing such work, and revert it after I am done:
I have the following folder structure:
On
eks
I am importing a Git module such as:On the
vpc
folder I import another Git module, a totally different repository:Sometimes, I am testing local changes to the
eks
module, and I want to use a local version of the source code to avoid committing changes to a branch to test it.Both repositories are cloned locally on
~/git
folder.When I do:
I get:
That's because,
vpc
is a dependency ofeks
, and that module is not found on~/git/terraform-aws-eks-module
.I understand usually Terragrunt uses the same "live" repository for all
source
attributes, so then all modules are on the same repository. If that was the case there would be no problem as it would find both modules on the same place.I wonder if it is not possible to still be able to use
--terragrunt-source
on this use case I have.I see a few options:
--terragrunt-source
, something like:--terragrunt-source
:--terragrunt-source
if they are coming from different Git repos than the module we are running. So it would work correctly with "live" single repositories by changing the source on all modules, while still avoiding this if the repositories are not the same. Possibly this logic can be tricky but definitely the one with less user configuration.For now, my workaround is to comment the files while I am doing such work, and revert it after I am done:
Thanks.
The text was updated successfully, but these errors were encountered: