diff --git a/pacu/modules/cloudformation__download_data/main.py b/pacu/modules/cloudformation__download_data/main.py index 3b6c90d3..67606db9 100755 --- a/pacu/modules/cloudformation__download_data/main.py +++ b/pacu/modules/cloudformation__download_data/main.py @@ -53,14 +53,16 @@ def default(self, obj): all_stacks = [] found_regions = [] for region in regions: - client = pacu_main.get_boto3_client('cloudformation', region) - print('Looking for CloudFormation Stacks in region {}...'.format(region)) - stacks_data = client.describe_stacks() - stacks = stacks_data['Stacks'] - all_stacks += stacks - - if stacks_data['Stacks']: - print('Getting exports for region: {}'.format(region)) + try: + client = pacu_main.get_boto3_client("cloudformation", region) + print("Looking for CloudFormation Stacks in region {}...".format(region)) + stacks_data = client.describe_stacks() + stacks = stacks_data["Stacks"] + all_stacks += stacks + except ClientError as e: + print(f"Error: Could not enumerate region {region}") + print(f"Error: {e}") + continue exports = client.list_exports() if exports: with outfile('exports', region) as (f):