aws-samples / service-screener-v2

A tool for customers to evaluate their AWS service configurations based on AWS and community best practices and receive recommendations on potential improvements.
Apache License 2.0
167 stars 46 forks source link

Terminated EC2 causing unhandling errors on _checkEC2SubnetAutoPublicIP #54

Closed kuettai closed 7 months ago

kuettai commented 7 months ago

Describe the bug Terminated EC2 causing unhandling errors on _checkEC2SubnetAutoPublicIP function

To Reproduce Steps to reproduce the behavior:

  1. Clone Repo
  2. Setup Alias
  3. Run command while EC2 is terminating or terminated

Full commands used to reproduce this bug e.g: screener --regions ALL --services ec2

Expected behavior Traceback (most recent call last): File "/home/cloudshell-user/sscreenerv2/service-screener-v2/services/Evaluator.py", line 28, in run getattr(self, method)() File "/home/cloudshell-user/sscreenerv2/service-screener-v2/services/ec2/drivers/Ec2Instance.py", line 306, in _checkEC2SubnetAutoPublicIP results = self.ec2Client.describe_subnets( File "/home/cloudshell-user/sscreenerv2/lib64/python3.9/site-packages/botocore/client.py", line 530, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/cloudshell-user/sscreenerv2/lib64/python3.9/site-packages/botocore/client.py", line 923, in _make_api_call request_dict = self._convert_to_request_dict( File "/home/cloudshell-user/sscreenerv2/lib64/python3.9/site-packages/botocore/client.py", line 991, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/home/cloudshell-user/sscreenerv2/lib64/python3.9/site-packages/botocore/validate.py", line 381, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Invalid type for parameter SubnetIds[0], value: None, type: <class 'NoneType'>, valid types: <class 'str'>

AWS CloudShell (please complete the following information):

Execution Environment (PLEASE FILL THIS UP IF YOU ARE NOT RUNNING THIS IN AWS CLOUDSHELL):

Additional context Add any other context about the problem here.

Original submitter: awhitespace