patrickchugh/terravision

Unhandled error: <class 'KeyError'>, 'cidr_block', <traceback object at 0x7f48ac46a540>

Opened this issue · 7 comments

I am getting this error for terravision draw --source $PWD

Analysing plan..

Unhandled error: <class 'KeyError'>, 'cidr_block', <traceback object at 0x7f48ac46a540>

Can you paste your block of code relating to subnets and VPCs here so I can try to reproduce the error?

I face the same error as welll .

I get the same issue

Analysing plan..

Unhandled error: <class 'KeyError'>, 'cidr_block', <traceback object at 0x106c8a2c0>

@Manickz @l-gatillon @kk-rishang Can you do a git pull on main branch and try again with the latest code?

Hi all! I cloned the last version from main branch and it still raise the "unhandled error" exception for 'cidr_block' fields.

My script defines an aws_vpc_endpoint resource used for the db Secret rotation. In tfwrapper.py file (row 247) terravision tries to parse the aws_vpc_endpoint resource searching for the cidr_block values, but it doesn't find them.
This raises exception.

@kk-rishang @rraffaello It seems the program was detecting VPC endpoints as VPCs, I added a fix and tested it works. Please git pull the latest code and try again.

$ terravision draw --source https://github.com/Rishang/demo-tf-1//project-stack/src --show
....
Enriched graphviz dictionary:

{
    "aws_cloudwatch_log_group.cloudwatch": [],
    "aws_ebs_volume.extra_volume~1": [
        "aws_instance.this~1",
        "aws_volume_attachment.extra_volume~1"
    ],
    "aws_group.shared_services": [
        "aws_cloudwatch_log_group.cloudwatch"
    ],
    "aws_iam_role.lambda_role~1": [
        "aws_iam_role_policy.lambda_policy~1"
    ],
    "aws_iam_role_policy.lambda_policy~1": [],
    "aws_instance.this~1": [],
    "aws_lambda_function.this~1": [
        "aws_cloudwatch_log_group.cloudwatch",
        "aws_cloudwatch_log_group.cloudwatch",
        "null_resource.archive~1"
    ],
    "aws_volume_attachment.extra_volume~1": [
        "aws_instance.this~1"
    ],
    "local_file.archive_plan~1": [
        "null_resource.archive~1"
    ]
}