Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for buckets in different regions #18

Open
tyilo opened this issue Sep 4, 2013 · 9 comments
Open

Add support for buckets in different regions #18

tyilo opened this issue Sep 4, 2013 · 9 comments

Comments

@tyilo
Copy link

tyilo commented Sep 4, 2013

When trying to use simples3 to connect to a bucket hosted in eu-west-1, I get the following error:

The bucket you are attempting to access must be addressed using the specified endpoint.
@heynairb
Copy link

+1

@Wakeupbuddy
Copy link

does this fixed or not?

@jjacarillo
Copy link

same issue here. this should be top prio.

@lericson
Copy link
Owner

lericson commented Mar 3, 2015

Tell me how you are trying to connect to it, I used simples3 with European servers many times!

@lericson
Copy link
Owner

lericson commented Mar 3, 2015

bucket = simples3.S3Bucket(name="mybucket", base_url="http://eu-west.whatever.com/")

I forget exactly how the incantation looks. I'm all for adding a simples3.connect though, or open. Suggestions?

@jjacarillo
Copy link

@lericson yes, I had to provide the full url (not just the base) into base_url for it to work. but it does not look so natural. but this looks pretty:

bucket = S3Bucket(name='mybucket', region='us-west1')

@lericson
Copy link
Owner

Alright, that sounds awesome. Could you perhaps post some example of how to use a different region, so it can be included in the documentation until we get a better API?

@mdauphin
Copy link

mdauphin commented Feb 1, 2016

I found a solution:

bucket = 'my_bucket'
access_key = 'AAAAAAAAAAAAAAAAAA'
secret_key = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'

s = simples3.S3Bucket(bucket,
    base_url="http://s3-eu-west-1.amazonaws.com/%s" % bucket,
    access_key=access_key,
    secret_key=secret_key)

s.put( 'todel.txt', 'blabla' )

@lericson
Copy link
Owner

lericson commented Feb 1, 2016

Good stuff, would do well to make a more obvious API though.

  • Ludvig

On 1 feb. 2016, at 10:44, mdauphin [email protected] wrote:

I found a solution:

bucket = 'my_bucket'
access_key = 'AAAAAAAAAAAAAAAAAA'
secret_key = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'

s = simples3.S3Bucket(bucket,
base_url="http://s3-eu-west-1.amazonaws.com/%s" % bucket,
access_key=access_key,
secret_key=secret_key)

s.put( 'todel.txt', 'blabla' )

Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants