Skip to content

Commit

Permalink
Fix issue checking existing bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpzx committed Sep 12, 2024
1 parent 01c65c8 commit 6e9fbb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/dataall/core/environment/cdk/environment_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,11 @@ def create_integration_tests_role(self):
's3:CreateBucket',
's3:DeleteBucket',
's3:PutEncryptionConfiguration',
's3:List*',
's3:GetObject*',
's3:DeleteObject',
],
effect=iam.Effect.ALLOW,
resources=['arn:aws:s3:::dataalltesting*'],
resources=['arn:aws:s3:::dataalltesting*', 'arn:aws:s3:::dataalltesting*/*'],
)
)
self.test_role.add_to_policy(
Expand Down Expand Up @@ -618,6 +617,7 @@ def create_integration_tests_role(self):
'kms:TagResource',
'kms:DescribeKey',
's3:GetBucketVersioning',
's3:List*',
],
effect=iam.Effect.ALLOW,
resources=['*'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def bucket_exists(self, bucket_name):
self._client.head_bucket(Bucket=bucket_name)
return True
except ClientError as e:
if e.response['Error']['Code'] == '404':
if e.response['Error']['Code'] in ['400', '403', '404']:
return False
else:
raise Exception(f'Error checking if bucket {bucket_name} exists: {e}')
Expand Down

0 comments on commit 6e9fbb1

Please sign in to comment.