in aws_resource_scan.py [0:0]
def scan_aws(service_collection, region_list, thread_limit):
"""Start scan of all AWS regions looking for specified services.
Args:
service_collection: service collection type. Default is basic limiting.
search to most common services, full would search for all services.
region_list: list of regions to search.
"""
Resources.resource_array = []
Resources.resource_count = 0
operation = []
while run_script:
if service_collection == 'basic':
services = ['ec2', 's3', 'route53', 'apigatewayv2', 'appconfig',
'appstream', 'appconfigdata', 'application-autoscaling',
'autoscaling', 'eks', 'efs', 'ebs', 'lambda', 'rds', 'sns',
'cloudfront', 'elasticbeanstalk', 'iam', 'glacier', 'kinesis',
'dynamodb', 'elasticache', 'redshift', 'sagemaker', 'sqs',
'lightsail', 'cloudwatch', 'chime', 'clouddirectory']
else:
services = get_services()
global _clients
region_count = 0
print('Collecting deployed resources using {} threads.'.format(thread_limit))
for region in region_list:
region_count = region_count + 1
regions = [region]
do_query(
services,
regions,
operation,
verbose=0,
parallel=thread_limit
)
_clients = {}
with open('./output/services/resources.json', 'w+', encoding='utf-8') as f:
json.dump(_resource_list, f, ensure_ascii=False, indent=4)
break
return