From b06a8b72c25900c41c9a93c0de8c44e3a1934a66 Mon Sep 17 00:00:00 2001 From: Iakov Gan Date: Wed, 8 Nov 2023 19:39:06 +0100 Subject: [PATCH] allow data collection bucket not to exist --- cfn-templates/cid-cfn.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfn-templates/cid-cfn.yml b/cfn-templates/cid-cfn.yml index f4b1c61a..5b9e2d0f 100644 --- a/cfn-templates/cid-cfn.yml +++ b/cfn-templates/cid-cfn.yml @@ -726,9 +726,9 @@ Resources: s3path = s3path.replace('{account_id}', account_id) parts = s3path.split('/') data['Bucket'] = parts[0] - if not bucket_exists(data['Bucket']) and type_.lower() != 'delete': - raise Exception(f'Bucket {parts[0]} does not exist. Please check prerequisites. Just creating a bucket is not enough.') if properties.get('type', '') == 'CUR': + if not bucket_exists(data['Bucket']) and type_.lower() != 'delete': + raise Exception(f'Bucket {parts[0]} does not exist. Please check prerequisites. Just creating a bucket is not enough.') # detect Type of CUR and choose the right partitions structure if len(parts[1:]) == 1: # most likely it is created by CFN or similar data['Partitions'] = partitions['managed_by_cfn']