aboisvert / s3cp

Amazon S3 command-line tools (e.g., cp, ls, cat, ...)
Apache License 2.0
74 stars 7 forks source link

S3 Endpoints #12

Open rjocoleman opened 11 years ago

rjocoleman commented 11 years ago

I spotted this: https://github.com/aboisvert/s3cp/blob/master/lib/s3cp/utils.rb#L47

FYI: aws/s3 has got a method to get this programatically: https://github.com/aws/aws-sdk-ruby/blob/master/lib/aws/s3/bucket.rb#L257

It maps to this: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html

aboisvert commented 11 years ago

Make sense ... but slightly different than the endpoint configuration.

What I'm thinking is the following, 1) Use S3CP_ENDPOINT if set, "us-east-1" as default. 2) Check bucket location_constraint (this will use the endpoint from #1). If location is restricted, switch to the necessary region. Otherwise, continue with endpoint set in #1.

Does that fit what you had in mind?

On Sun, May 19, 2013 at 12:59 AM, Robert Coleman notifications@github.comwrote:

I spotted this: https://github.com/aboisvert/s3cp/blob/master/lib/s3cp/utils.rb#L47

FYI: aws/s3 has got a method to get this programatically: https://github.com/aws/aws-sdk-ruby/blob/master/lib/aws/s3/bucket.rb#L257

It maps to this: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html

— Reply to this email directly or view it on GitHubhttps://github.com/aboisvert/s3cp/issues/12 .

rjocoleman commented 11 years ago