Closed atqhg23 closed 2 years ago
Can you please test https://github.com/servian/aws-auto-cleanup/tree/security-group-fix
For sure, thanks, I will test this in the morning (EST where I'm at) and will send an update.
When there are no security groups in the whitelist, the cleanup runs successfully, but this error comes up when there is a security group in the whitelist:
[ERROR] TypeError: unhashable type: 'dict'
Traceback (most recent call last):
File "/var/task/src/main.py", line 608, in lambda_handler
cleanup.run_cleanup()
File "/opt/python/func_timeout/dafunc.py", line 185, in <lambda>
return wraps(func)(lambda *args, **kwargs : func_timeout(defaultTimeout, func, args=args, kwargs=kwargs))
File "/opt/python/func_timeout/dafunc.py", line 108, in func_timeout
raise_exception(exception)
File "/opt/python/func_timeout/py3_raise.py", line 7, in raise_exception
raise exception[0] from None
File "/var/task/src/main.py", line 316, in run_cleanup
ec2_class.run()
File "/var/task/src/ec2_cleanup.py", line 47, in run
self.security_groups()
File "/var/task/src/ec2_cleanup.py", line 377, in security_groups
if resource not in resource_whitelist:
Issue fixed. Was comparing the wrong variable against the whitelist :)
Ah I missed that, will test to confirm
Apologies for the late response. I just tested this and everything works
Describe the bug When a security group is added to the whitelist, the action in the execution log is blank.
To Reproduce
Expected behavior The execution log action should say "SKIP - WHITELIST"
AWS (please complete the following information):