patrickchugh / terravision

Terravision creates Professional Cloud Architecture Diagrams from your Terraform code automatically. Supports AWS, Google and Azure.
Mozilla Public License 2.0
768 stars 77 forks source link

Unable to handle module iam-role-for-service-accounts-eks #103

Open Multox opened 7 months ago

Multox commented 7 months ago

I'm using this module: https://registry.terraform.io/modules/terraform-aws-modules/iam/aws/latest/submodules/iam-role-for-service-accounts-eks

Usage is like this:

module "load_balancer_irsa" {
  source    = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
  ...
}

When running Terravision it generates this error

Added Source Location: ./.terraform/modules/load_balancer_irsa
ERROR: No Terraform .tf files found in current directory or your source location. Use --source parameter to specify location or Github URL of source files

The error is correct, there are indeed no .tf files in the location "./.terraform/modules/load_balancer_irsa" This is because the module is actually at ./.terraform/modules/load_balancer_irsa/modules/iam-role-for-service-accounts-eks

I don't know if there's a work-around, but I am using the module correctly according to the example in the documentation. (The deployment does work)

Btw, thanks for making this project! It looks great and I'm looking forward to seeing my architecture diagrammed by this!

crockie commented 3 months ago

I am also experiencing the same issues with the use of modules.

@Multox I found the bug in fileparser.py and it appears that under the iterative_parse function, and in the module section, it should call find_tf_files with the recursive param set to true. With the above changes, the program is able to find all the tf files in the modules folder.

@patrickchugh However, the program is now stuck in Processing resources

crnakad commented 3 months ago

I managed to make it work when setting the recursive param to true, but I am getting Unhandled error: <class 'RecursionError'>, maximum recursion depth exceeded while calling a Python object later on in Processing resources

Increasing the system recursion limit results in a Segmentation fault (core dumped) error