-
-
Notifications
You must be signed in to change notification settings - Fork 965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run-all destroy wrong dependent order, missing warning about dependent module and cannot remove dependent modules of a specific one #3371
Comments
Hello, |
Sorry, what do you mean? |
I mean that finding of dependent modules is based on checking dependencies from the base of git repository, if code is not in git repository, dependent modules finding may not work |
The modules are local modules located in the folder modules/. These modules are simple terraform modules. Then, the dependencies between them (declared in the teffragrunt.hcl files) are not respected in destroy operations, i don't think it is a matter of git or local but only of how the tree of operations is built. If you look at the examples, dependency graph and expected result i think is pretty clear. Let me know if you need more specs/details/whatever. Thanks. P.S. i think that the linked issue is exactly what could fix this Edit: if you look at example 6, removing the stack
while i would expect the following operations in the following order:
|
Describe the bug
Terragrunt run-all destroy in a specific folder doesn't removes or prompt for dependent modules (that are also not used by any other module).
Steps To Reproduce
This is my project structure:
Scenarios:
terragrunt run-all plan
orterragrunt run-all apply
inorganization_1/account_1/us-east-1
folder it works as expected plans/creates/modify ALL the resources in the regionmodules order result:
terragrunt run-all destroy
inorganization_1/account_1/us-east-1
it works as expected destroys ALL the resources IN THE SPECIFIED ORDER, in the regionmodules order result:
terragrunt run-all plan
orterragrunt run-all apply
inorganization_1/account_1/us-east-1/b
folder it works as expected destroys ALL the resources IN THE SPECIFIED ORDER, in the regionmodules order result:
terragrunt destroy
inorganization_1/account_1/us-east-1/b
folder it DOES WARN about a dependent module, as expected.modules order result:
terragrunt run-all destroy
inorganization_1/account_1/us-east-1/b
folder it DOES NOT WARN about dependent modules, an DOES NOT attempt to delete any dependent module (the same goes for the commandterragrunt run-all destroy --terragrunt-working dir ./b
).modules order result:
the same if i run the command
terragrunt run-all destroy
inorganization_1/account_1/us-east-1/c
folder it DOES NOT WARN about dependent modules, an DOES NOT attempt to delete any dependent module (the same goes for the commandterragrunt run-all destroy --terragrunt-working dir ./c
).modules order result:
terragrunt run-all destroy --terragrunt-include-dir ./c --terragrunt-include-dir ./d
fromorganization_1/account_1/us-east-1
returned a strange result:modules order result:
Here a dependencies graph generated via
terragrunt graph-dependencies
:There is a way to remove a specific module and all dependent ones?
As an example, i want to remove b, so, the expected output, should be:
An other example, running
run-all destroy
inorganization_1/account_1/eu-east-1/c
should produce something like:An other example, running
run-all destroy
inorganization_1/account_1/eu-east-1/a
should produce something like:Expected behavior
Terragrunt run-all destroy in a specific folder doesn't removes or prompt for dependent modules (that are also not used by any other module).
Trying to remove a "stack" of dependent modules fails, i tried almost all combination of include/exclude flags without obtaining the wanted result (only specifying every module dir include/exclude, but that's not a feasible approach at all).
As an example, i want to remove b, so, the expected output, should be:
An other example, running
run-all destroy
inorganization_1/account_1/eu-east-1/c
should produce something like:An other example, running
run-all destroy
inorganization_1/account_1/eu-east-1/a
should produce something like:Versions
Additional context
Trying to remove a "stack" of dependent modules fails, i tried almost all combination of include/exclude flags without obtaining the wanted result (only specifying every module dir include/exclude, but that's not a feasible approach at all).
The text was updated successfully, but these errors were encountered: