Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I’m trying to perform a PUT operation towards Spaces using AWS S3 Java SDK, but I keep getting the same error.
Here’s the definition of the client:
public AmazonS3 spaces() {
BasicAWSCredentials credentials = new BasicAWSCredentials(...);
return AmazonS3ClientBuilder.standard().
withCredentials(new AWSStaticCredentialsProvider(credentials)).
withPathStyleAccessEnabled(true).
withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("bucketname.ams3.digitaloceanspaces.com", "ams3")).
build();
}
Here’s usage:
spaces.putObject("bucketname", fullPath, tempFile);
And the error is:
com.amazonaws.services.s3.model.AmazonS3Exception: Bad request (Service: Amazon S3; Status Code: 400; Error Code: 400 Bad request; Request ID: null; S3 Extended Request ID: null)
SDK version:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.274</version>
</dependency>
I tried to replace AwsClientBuilder.EndpointConfiguration("bucketname.ams3.digitaloceanspaces.com", "ams3") with AwsClientBuilder.EndpointConfiguration("ams3.digitaloceanspaces.com", "ams3"), but it also didn’t work.
And when I try to GET the file, I surprisingly get a different error:
com.amazonaws.services.s3.model.AmazonS3Exception: null (Service: Amazon S3; Status Code: 403; Error Code: SignatureDoesNotMatch; Request ID: ...; S3 Extended Request ID: ...)
Although I’m pretty sure that I’ve specified key and secret correctly: I double-checked it.
BYUKUSENGE1122
efc7faea746444dc908905614d8f9e
a9b6ec20aac54b7fb8b665177d1414
013e7d0b6b004201b23bba10789eaa
LittleTurquoiseSeal
Sen Wang
4d93f2f07ce540cbb84c4d97e835bc
Dani
d06b3a356d374ee6a0a12809b4783f
Gavin Lasco
14ed7f5e756d40a9971bfff98e543a