aws-sdk-java-v2
aws-sdk-java-v2 copied to clipboard
Support S3 Transfer acceleration Transfer Manager V2 SDK
Describe the feature
V2 SDK Transfer manager doesn't have support of enabling transfer acceleration https://docs.aws.amazon.com/AmazonS3/latest/userguide/transfer-acceleration.html, while V1 SDK of Transfer manager supported it.
Is your Feature Request related to a problem?
Required for migrating V1 Transfer manager SDK to V2
Proposed Solution
No response
Describe alternatives you've considered
No response
Acknowledge
- [ ] I may be able to implement this feature request
AWS Java SDK version used
2.17.16-PREVIEW
JDK version used
N/A
Operating System and version
N/A
It would be great to have transfer acceleration in aws sdk v2. Equivalent API in SDK v1: https://github.com/aws/aws-sdk-java/blob/1c94d1504753629995764231a311f787d42a9c8c/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Builder.java#L239,
I'm trying to set the accelerate endpoint via the endpointOverride method to https://<bucketname>.s3-accelerate.amazonaws.com
as suggested in the Transfer Acceleration User Guide but I don't get to make it work.
Example:
URI endpointUri = new URI("https://" + bucketName + ".s3-accelerate.amazonaws.com");
S3TransferManager transferManager = S3TransferManager.builder()
.s3ClientConfiguration(cfg -> {
cfg.credentialsProvider(credentialProvider)
.endpointOverride(endpointUri)
.region(region);
})
.build();
//...
FileUpload upload = transferManager.uploadFile(u -> u.source(Paths.get(file.getPath()))
.putObjectRequest(p -> p.bucket(dest.bucket()).key(s3DestKey))
.overrideConfiguration(o -> o.addListener(LoggingTransferListener.create())));
upload.completionFuture().join();
When it starts to upload the file I get the following error:
software.amazon.awssdk.services.s3.model.S3Exception: The request signature we calculated does not match the signature you provided. Check your key and signing method. (Service: S3, Status Code: 403,...
With the debug on I can see that the request is using the following parameters:
httpMethod=PUT, protocol=https, host=bucketName.s3-accelerate.amazonaws.com, port=443, encodedPath=/bucketName/key
My intuition says that the bucketName should not be in both the host and the path as part of the key. Any way to make this work using the endpointOverride?
SDK version: 2.17.177-PREVIEW
It'd be nice to add support of transfer acceleration to S3 presigned url (i.e. as in Presigner
method). I could only find this thread where it's available in ruby.