mirror of
https://github.com/patrickchugh/terravision.git
synced 2026-05-09 08:25:25 +02:00
[GH-ISSUE #146] TypeError: 'type' object is not subscriptable #86
Labels
No labels
bug
enhancement
enhancement
good first issue
good first issue
good first issue
pipeline
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/terravision#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jtallar-hu on GitHub (Oct 27, 2025).
Original GitHub issue: https://github.com/patrickchugh/terravision/issues/146
I was just trying to use this tool on one of my Terraform projects and I'm getting this error when running
terravision draw --source prd/main.tfI tried with different project structures (using local modules, using AWS modules, simple TF configuration).
I also tried installing the requirements with different Python versions (3.9.24, 3.11.9, 3.13.9). All throw the same error.
How can I fix this issue?
@patrickchugh commented on GitHub (Oct 28, 2025):
Would you be able to share some example repo so I can try to reproduce it ?
@jtallar-hu commented on GitHub (Oct 29, 2025):
I've just uploaded a sample repository here: https://github.com/jtallar/sample-tf-project-terravision
I followed these steps:
Which throws the following error
@patrickchugh commented on GitHub (Oct 31, 2025):
Thanks give me a few days to check it out for you
@patrickchugh commented on GitHub (Nov 1, 2025):
@patrickchugh commented on GitHub (Nov 1, 2025):
Hi, I managed to create a diagram from your example repo with
terravision draw --source https://github.com/jtallar/sample-tf-project-terravision.gitCan you do a git pull to get the latest code and try again? I wasn't able to reproduce your error but made some fixes that may help your case. If it still doesn't work I think it's probably an environment or python ver difference so please try with the latest python 3.11 as well.
Thanks and let me know how it goes.
@jtallar-hu commented on GitHub (Nov 3, 2025):
Hi Patrick!
That seems to have solved that issue. I'm now facing a separate issue when running the command against my full infrastructure (which has AWS modules and local sub-modules). In fact,
aws_sns_topic_subscription.messages_sns_to_sqsis a sub-resource in one of my modules.But I'll be doing some more testing and trying to replicate it in the sample repository so I can share an example where this happens. I think we can close this issue and and I'll open a new one for that error.
Many thanks!
Edit
It appears to be a similar issue as in https://github.com/patrickchugh/terravision/issues/121
@patrickchugh commented on GitHub (Nov 3, 2025):
Hi, FYI if you prefer you can run terravision with the --debug flag and it will create a tfdata.json file in the current directory. This can be compressed and sent to me to replay the processing of your source without sharing the source. I can find the bug that way.
@jtallar-hu commented on GitHub (Nov 9, 2025):
I was just getting back to this issue. The debug flag did not generate any
tfdata.jsonfile in my current directory. But it did output some more information about the error. I've been able to replicate it in my sample project at https://github.com/jtallar/sample-tf-project-terravision.I created a new
serviceTF module which just imports themessagesmodule from before.Running
terravision drawworks OK with themessagesmodule and it generates the architecture diagram as expected.terravision draw --source ~/Desktop/Random/sample-tf-project-terravision/messagesBut if I run it agains the
servicemodule, it fails with a similar error to the one shown above.terravision draw --source ~/Desktop/Random/sample-tf-project-terravision/service --debugHere is the complete output of that run.
@patrickchugh commented on GitHub (Nov 15, 2025):
Hi @jtallar-hu Can you try again with the latest code I pushed ? I am able to see a diagram from your service module now. FYI the tfdata.json file is only created once there are no errors in processing the original terraform command outputs.
@patrickchugh commented on GitHub (Dec 16, 2025):
closing as assumed resolved