google/cloud-forensics-utils

instance.Delete() fails if no VPC is attached

cugu opened this issue · 3 comments

cugu commented

instance.Delete() fails if no VPC is attached.

Failing example code snippet:

instance = account.ec2.GetInstanceById(instance_id)
instance.Delete()

A key error is thrown at:

I am finding it hard to repro this as its not currently possible to create an EC2 instance without a VPC, as far as I can tell

However it doesn't appear as though VPC is required for the delete procedure, so I don't see why we can't just set a default for this value if it doesn't exist

cugu commented

Not sure how this occurred, but had this happen in an investigation. Thanks for the fix!