Open queglay opened 3 years ago
I'm not sure I follow. What behavior are you expecting for each of those? What does your folder structure look like?
The folder structure is as the log shows above.
For example I am running from ~/environment/firehawk. Directly in there would be one example folder:
firehawk-init/modules/private-tls-cert
I was expecting terragrunt run-all apply --terragrunt-include-dir ./firehawk-init
to include that folder above but it doesn't.
Sorry I realised that was an ambiguous example - it wasn't excluded in the first example, but only in the second. But the next line was always excluded:
Module /home/ec2-user/environment/firehawk/firehawk-init/modules/terraform-aws-iam-profile-packer (excluded: true, dependencies: [])
That also is contained in the same dir firehawk-init
, but it is excluded and I dont think it should be.
I'm also seeing similar behaviour.
I'm not sure I follow. What behavior are you expecting for each of those? What does your folder structure look like?
While I can't necessarily answer for the original poster, I can tell you what I would expect based on what they supplied:
terragrunt run-all apply --terragrunt-include-dir /home/ec2-user/environment/firehawk/firehawk-init/modules/**
I would expect these two entries, which are the second and third line down in their module output to be excluded: false
because it is contained within the firehawk-init/modules
directory and should be glob-matched by the **
=> Module /home/ec2-user/environment/firehawk/firehawk-init/modules/private-tls-cert (excluded: false, dependencies: [])
=> Module /home/ec2-user/environment/firehawk/firehawk-init/modules/terraform-aws-iam-profile-packer (excluded: true, dependencies: [])
include-dir
.*
and **
). excluded: false
, or neither. I can't see any reason for being treated differentlyDigital Ocean's interactive glob checker also says they both match.
I also have my own issues with relative paths:
gchappel99@gchappell99 ~/terragrunt/accounts/account1 » terragrunt run-all apply --terragrunt-include-dir "us-central1/**" --terragrunt-include-dir "global/vpcs/**" --terragrunt-include-dir "europe-west4/**"
INFO[0000] Stack at /Users/gchappell99/terragrunt/accounts/account1:
=> Module /Users/gchappell99/terragrunt/accounts/account1 (excluded: true, dependencies: [])
* => Module /Users/gchappell99/terragrunt/accounts/account1/europe-west4/test-vpc/subnets (excluded: true, dependencies: [/Users/gchappell99/terragrunt/accounts/account1/global/vpcs/test-vpc])
=> Module /Users/gchappell99/terragrunt/accounts/account1/global/dns/zone1.domain.com (excluded: true, dependencies: [])
=> Module /Users/gchappell99/terragrunt/accounts/account1/global/dns/zone2.domain.com (excluded: true, dependencies: [])
=> Module /Users/gchappell99/terragrunt/accounts/account1/global/dns/zone3.domain.com (excluded: true, dependencies: [])
=> Module /Users/gchappell99/terragrunt/accounts/account1/global/dns/zone4.domain.com (excluded: true, dependencies: [])
=> Module /Users/gchappell99/terragrunt/accounts/account1/global/vpcs/test-vpc (excluded: false, dependencies: [])
=> Module /Users/gchappell99/terragrunt/accounts/account1/us-central1/cloud-run-service (excluded: false, dependencies: [/Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc/serverless-connector])
* => Module /Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc/cloud-router (excluded: true, dependencies: [/Users/gchappell99/terragrunt/accounts/account1/global/vpcs/test-vpc, /Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc/egress-ip, /Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc/subnets])
* => Module /Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc/egress-ip (excluded: true, dependencies: [/Users/gchappell99/terragrunt/accounts/account1/global/vpcs/test-vpc])
=> Module /Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc/serverless-connector (excluded: false, dependencies: [/Users/gchappell99/terragrunt/accounts/account1/global/vpcs/test-vpc, /Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc/subnets])
=> Module /Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc/subnets (excluded: false, dependencies: [/Users/gchappell99/terragrunt/accounts/account1/global/vpcs/test-vpc])
=> Module /Users/gchappell99/terragrunt/accounts/account1/us-central1/test-vpc2 (excluded: false, dependencies: [])
=> Module /Users/gchappell99/terragrunt/accounts/account1/us/bootstrap (excluded: true, dependencies: [])
Are you sure you want to run 'terragrunt apply' in each folder of the stack described above? (y/n)
I have highlighted three lines with a *
prefix; these are entries which I believe should be included based on my current working directory and the include-dir
glob I provided. Again, in this case there are some folders which are siblings of either other in my directory hierarchy, but some are included and some are excluded, and I don't see a reason (or a fix) for this.
I'm finding some odd behaviour with --terragrunt-include-dir. First it doesn't seem to think more than one sub dir should be included in this example:
More importantly I also find that a relative path doesn't work at all.
I have tried other variants of the above commands with and without wildcards.
The version is: