diff --git a/lib/s3.py b/lib/s3.py index c3cf9d7..c9f3d19 100644 --- a/lib/s3.py +++ b/lib/s3.py @@ -21,7 +21,7 @@ def upload_file_to_s3(bucket: str, filename: str): except ClientError as e: if e.response['Error']['Code'] == 'NoSuchBucket' or int(e.response['Error']['Code']) in [403, 404]: # Create the bucket since it does not exist - s3_client.create_bucket(Bucket=bucket) + s3_client.create_bucket(Bucket=bucket, CreateBucketConfiguration={'LocationConstraint': region}) logger.info(f'Created bucket {bucket} in MinIO.') else: # Other errors like permissions issues