Description
S3 MRAP (Multi-Region Access Points) is not supported in multipart operations, currently. The S3 team has a task in their backlog to support it. Once it gets added, we'll enable in the S3TransferManager.
Discussed in #3969
Originally posted by sreenivasamaram May 2, 2023
Hello, We are unable to upload file to Amazon S3 Multi-Region Access Points using Amazon S3 Transfer Manager API and receiving below error
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: upload does not support S3 multi-region access point ARN
We have followed this sample code given by AWS - https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/transfer-manager.html - Upload a file to an S3 bucket
=====
public String uploadFile(S3TransferManager transferManager, String bucketName,
String key, String filePath) {
UploadFileRequest uploadFileRequest =
UploadFileRequest.builder()
.putObjectRequest(b -> b.bucket(bucketName).key(key))
.addTransferListener(LoggingTransferListener.create())
.source(Paths.get(filePath))
.build();
FileUpload fileUpload = transferManager.uploadFile(uploadFileRequest);
CompletedFileUpload uploadResult = fileUpload.completionFuture().join();
return uploadResult.response().eTag();
}
S3 transfer manager
================
S3CrtHttpConfiguration httpConfig = S3CrtHttpConfiguration.builder().proxyConfiguration(S3CrtProxyConfiguration.builder().host(XXX).port(XXXX)
.username(XXXXX)
.password(XXXXX)
.build()).build();
S3AsyncClient s3AsyncClient =
S3AsyncClient.crtBuilder()
.httpConfiguration(httpConfig)
.credentialsProvider(StaticCredentialsProvider.create(AwsSessionCredentials.create(XXXX)))
.region(XXXX)
.targetThroughputInGbps(20.0)
.minimumPartSizeInBytes(new Long(8 * 1024))
.build();
S3TransferManager transferManager = S3TransferManager.builder()
.s3Client(s3AsyncClient)
.build();
=====
Above code is working as expected if we upload file to S3 bucket directly, but receiving error when we tried to use the MRAP ARN instead of S3 bucket.
Could you please review and let's know how to fix this issue.
Greatly appreciated your support on this.