From 545998b996b343932ac12e75a500594adad0478b Mon Sep 17 00:00:00 2001 From: carnal0wnage Date: Fri, 23 Jun 2017 12:12:23 -0400 Subject: [PATCH] few more updates to the config piece --- logging_list_monitoring_configuration.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/logging_list_monitoring_configuration.py b/logging_list_monitoring_configuration.py index 2d95f95..1c2139b 100644 --- a/logging_list_monitoring_configuration.py +++ b/logging_list_monitoring_configuration.py @@ -9,12 +9,6 @@ from config.config import * regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', ] - - - - - - def print_section_header_and_footer(text, end=False): print("-" * 50) print(text) @@ -37,11 +31,10 @@ for region in regions: print(config_service_text) print("Region:" + region) print_config_text(config_service_text) - - print response - print len(response['ConfigurationRecorders']) - if len(response['ConfigurationRecorders']) <= 0: + if response.get('ConfigurationRecorders') is None: + print "{} likely does not have Config permissions\n" .format(AWS_ACCESS_KEY_ID) + elif len(response['ConfigurationRecorders']) <= 0: print("NO CONFIGURATION DETECTED") else: for group in response['ConfigurationRecorders']: