question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

S3 get_driver using region name

See original GitHub issue

For some reason it seems there is one driver for each S3 region. Thus we cannot dynamically get a s3 driver depending on the region string.

For example something like this:

cls = get_driver(Provider.S3, region_name='eu-west-1')

Or maybe it would be better to have only one S3StorageDriver class where we can specify the region during construction.

driver = cls(access_key_id, secret_acces_key, region=region_name, region_name=region_name)

Though it seems there is two region attribute which should match. region_name from S3StorageDriver and region from AWSDriver.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Kamicommented, Nov 6, 2019

The best approach would probably be to support region argument in the driver constructor.

That’s something we already do in other drivers and similar to what you suggested in option 2).

0reactions
Kamicommented, Nov 26, 2019

Thanks for confirming 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel league/flysystem getting file URL with AWS S3
I am using Laravel 5.2 and the code below seemed to work fine. Storage::cloud()->url('filename');.
Read more >
Get the Region where the Amazon S3 bucket resides using an ...
Get the Region where the Amazon S3 bucket resides using an AWS SDK. PDFRSS. The following code example shows how to get the...
Read more >
How to upload file private mode and retrive by generated url ...
Here is complete code: upload file in aws s3 from laravel 5.3 or 5.4 Run: ... file or video (i have upload one...
Read more >
Upload files to S3 and generate previews using Laravel
Our Document model will have a name , file (a URL on S3 to our original file), preview_url (a URL to a preview...
Read more >
File Storage - Laravel - The PHP Framework For Web Artisans
Before using the S3 driver, you will need to install the Flysystem S3 ... For this reason, we recommend always storing your files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found