TgPlanAllExitCode and TgApplyAll is work for current module , not plan and apply for nested dependency module
TgPlanAllExitCode and TgApplyAll is not plan/apply for parent module . i.e if i am running test on VCN module and compartment i put as mock_output . It is not planning and apply for compartment module . It is only plan for current directory means VCN .
Is there a way to fix this ?
The --non-interactive flag is set. To avoid accidentally affecting external dependencies with an xxx-all command, will not run this command against module /Users/dmaharan/Ddrive/demoRepo/terratestDevelop/cxu-tf-infra/dev/global/app/compartment, which is a dependency of module /Users/dmaharan/Ddrive/demoRepo/terratestDevelop/cxu-tf-infra/dev/iad/fabric/app/network/vcn. How to make here external dependency to true How we can add "terragrunt-include-external-dependencies" to TgApplyAll and TgdestroyAll
@yorinasub17 is there any solution for this ?
Ideally you can run plan-all and apply-all on the root folder so that includes all the dependencies.
Otherwise, we need an enhancement to the terraform.Options struct to support the ability to pass in arbitrary extra args to the command. We are unlikely to get to this anytime soon, so if anyone in the community wants to contribute a PR that would be much appreciated!
@DiptiPrakash
Could please pass me snippet of code which helps me to set --terragrunt-include-external-dependencies flag to true
I am getting error due to that https://github.com/gruntwork-io/terragrunt/issues/1417
hi @pandu-bhojaraj-mf, please try the following:
options := &Options{
TerraformDir: testFolder,
TerraformBinary: "terragrunt",
EnvVars: map[string]string{
"TF_CLI_ARGS": "--terragrunt-include-external-dependencies",
},
}
terraform.TgApplyAll(t, options)
Feel free to tweak it based on your use case. If Terragrunt doesn't parse TF_CLI_ARGS, then you could try to invoke a different method directly: RunTerraformCommandE(t, options, FormatArgs(options, "apply-all", "-input=false", "-lock=false", "-auto-approve", "--terragrunt-non-interactive", "--terragrunt-include-external-dependencies")...).
Hi @robmorgan
Below code is not working
options := &Options{ TerraformDir: testFolder, TerraformBinary: "terragrunt", EnvVars: map[string]string{ "TF_CLI_ARGS": "--terragrunt-include-external-dependencies", }, } terraform.TgApplyAll(t, options)
Both approached dint work