I'm using jclouds and trying to abstract away S3 access. However, when attempting to get an object I get the following exception:
org.jclouds.aws.AWSResponseException: request GET https://test-itpx.s3.amazonaws.com/marcel-mini.jpeg HTTP/1.1 failed with code 400, error: AWSError{requestId='0FB8701BF3CE81EB', requestToken='XXX', code='AuthorizationHeaderMalformed', message='The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-1'', context='{Region=eu-west-1, HostId=XXX=}'}
By the looks of it S3 needs an explicit region definition and answers such as this one suggest to explicitly define it.
Unfortunately, the blob context builder offers no way to specify the region. The way I define the context is:
val context = ContextBuilder.newBuilder("aws-s3")
.credentials("access_key", "access_secret")
.buildView(BlobStoreContext::class.java)
And the object get is a simple getBlob:
context.storageContext.getBlob(source.bucket, source.key)
Is there a way to do explicitly define an s3 region / location with jclouds?
I'm using jclouds-allblobstore version 2.1.2.