aws-sdk-java icon indicating copy to clipboard operation
aws-sdk-java copied to clipboard

AmazonS3.createBucket(bucketName) should use region set with setRegion()

Open axelfontaine opened this issue 13 years ago • 3 comments

This makes the interface a lot more natural. Set on region and then expect all subsequent calls to target on that region by default. The current behavior is confusing.

axelfontaine avatar Jul 17 '13 19:07 axelfontaine

Thanks for the feature request. We have added this to our backlog.

wmatveyenko avatar Aug 09 '13 17:08 wmatveyenko

I took a look at this. There's already a function in AmazonS3Client (getRegion()) that gets the region from the superclass and defaults to US_Standard if it hasn't been set. I think the easiest course for createBucket(bucketName) is to pass the value from getRegion as a second parameter into the CreateBucketRequest. I'm sending a pull request for this change.

kelcecil avatar Dec 08 '13 15:12 kelcecil

I believe this has been fixed at the client level: https://github.com/aws/aws-sdk-java/blob/3baab096839f6848eed40940fb7b6f519a8e0580/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L771-L786

hanshuo-aws avatar Apr 17 '15 18:04 hanshuo-aws