Hello,
Im trying to create a terraform graph of my entire infrastructure. not just the individual modules.
my project structure is as follows:
myproject
โโโ production
โย ย โโโ nic-vm1
โย ย โย ย โโโ terragrunt.hcl
โย ย โโโ nic-vm2
โย ย โย ย โโโ terragrunt.hcl
โย ย โโโ subnet-vm1
โย ย โย ย โโโ terragrunt.hcl
โย ย โโโ subnet-vm2
โย ย โย ย โโโ terragrunt.hcl
โย ย โโโ aks-prod
โย ย โย ย โโโ terragrunt.hcl
โ โโโโ terragrunt.hcl
โโโ modules
โโโ azurerm_nic
โย ย โโโ main.tf
โย ย โโโ outputs.tf
โย ย โโโ vars.tf
โโโ azurerm_aks
โย ย โโโ main.tf
โย ย โโโ outputs.tf
โย ย โโโ vars.tf
โโโ azurerm_vm
ย ย โโโ main.tf
ย ย โโโ outputs.tf
ย ย โโโ vars.tf
If I got into each production item (vm1, vm2 etc..) i can run terragrunt graph and use the output and it will automatically include any dependencies for that item.
When i build my infrastructure, i simply run terragrunt apply-all from the production directory, which will use the top level terragrunt.hcl.
What I dont know how to do, it get a terragrunt graph-all type output which shows my entire infrastructure in one command. Or even a way of concatenating the outputs from the individual terragrunt graphs would work.
This modular layout that im using seems very popular, so im suprised nobody has asked it before. unless there is something obvious about how to do it that im missing.
```
I've personally found the graph command to not be too useful for large infrastructure, as the graph gets too big and intertwined to read... But if you can find a way to support this, a PR is welcome. See also #492.
I just ran the following: https://github.com/gruntwork-io/terragrunt/pull/1117
Which looked like this:
terragrunt graph-dependencies | dot -Tsvg > graph.svg
And it does the job!
The formatting isnt ideal, but i can play around with that myself.
Most helpful comment
I've personally found the
graphcommand to not be too useful for large infrastructure, as the graph gets too big and intertwined to read... But if you can find a way to support this, a PR is welcome. See also #492.