diff --git a/ec2.py b/ec2.py index 7bc1da3..00fac04 100644 --- a/ec2.py +++ b/ec2.py @@ -1,5 +1,6 @@ import boto3 from boto3.s3.transfer import S3Transfer +from boto3.s3.transfer import TransferConfig import base64 import os @@ -271,7 +272,8 @@ def create_s3_bucket(s3_client, bucket_name): return bucket_name def upload_files_to_s3(s3_client, bucket_name, folder_path): - transfer = S3Transfer(s3_client) + config = TransferConfig(multipart_chunksize=50 * 1024 * 1024) + transfer = S3Transfer(s3_client, config) for root, dirs, files in os.walk(folder_path): for file in files: file_path = os.path.join(root, file)