22'use strict' ;
33
44const _ = require ( 'lodash' ) ;
5- const { S3 } = require ( '@aws-sdk/client-s3' ) ;
65
76const config = require ( '../../../config' ) ;
87const P = require ( '../../util/promise' ) ;
@@ -13,6 +12,7 @@ const size_utils = require('../../util/size_utils');
1312const BlockStoreBase = require ( './block_store_base' ) . BlockStoreBase ;
1413const { RpcError } = require ( '../../rpc' ) ;
1514const { NodeHttpHandler } = require ( "@smithy/node-http-handler" ) ;
15+ const noobaa_s3_client = require ( '../../sdk/noobaa_s3_client/noobaa_s3_client' ) ;
1616
1717
1818const DEFAULT_REGION = 'us-east-1' ;
@@ -40,7 +40,7 @@ class BlockStoreS3 extends BlockStoreBase {
4040 RoleSessionName : 'block_store_operations'
4141 } ;
4242 } else {
43- this . s3cloud = new S3 ( {
43+ this . s3cloud = noobaa_s3_client . get_s3_client_v3_params ( {
4444 endpoint : endpoint ,
4545 credentials : {
4646 accessKeyId : this . cloud_info . access_keys . access_key . unwrap ( ) ,
@@ -58,13 +58,14 @@ class BlockStoreS3 extends BlockStoreBase {
5858 config . EXPERIMENTAL_DISABLE_S3_COMPATIBLE_DELEGATION . DEFAULT ;
5959 this . disable_metadata = config . EXPERIMENTAL_DISABLE_S3_COMPATIBLE_METADATA [ this . cloud_info . endpoint_type ] ||
6060 config . EXPERIMENTAL_DISABLE_S3_COMPATIBLE_METADATA . DEFAULT ;
61- this . s3cloud = new S3 ( {
61+ this . s3cloud = noobaa_s3_client . get_s3_client_v3_params ( {
6262 endpoint : endpoint ,
6363 forcePathStyle : true ,
6464 credentials : {
6565 accessKeyId : this . cloud_info . access_keys . access_key . unwrap ( ) ,
6666 secretAccessKey : this . cloud_info . access_keys . secret_key . unwrap ( ) ,
6767 } ,
68+ region : DEFAULT_REGION ,
6869 applyChecksum : cloud_utils . disable_s3_compatible_bodysigning ( endpoint ) ,
6970 requestHandler : new NodeHttpHandler ( {
7071 httpsAgent : http_utils . get_unsecured_agent ( endpoint )
0 commit comments