adonisjs / drive-s3

S3 driver for AdonisJS drive
MIT License
21 stars 9 forks source link

S3 Driver - Switching buckets at run time #8

Closed thetutlage closed 2 years ago

thetutlage commented 2 years ago

Discussed in https://github.com/adonisjs/core/discussions/3690

Originally posted by **justDare** April 23, 2022 With the S3 Driver, we setup a bucket in the environment variables which the driver uses for operations with the S3 class. My questions is: **Can we switch buckets at run time using the S3 Driver?** My use case is that my company has many S3 buckets they use within the codebase, which bucket I am reading and writing to may differ depending on the controller. I've looked into the docs and the source code and can't find any work arounds as the bucket is fed in from the env vars and stored as a private property. Any ideas on a workaround? Is there anything I missed? I'd be happy to contribute to the docs if there is a workaround. Many other frameworks have this option with their file storage options and I could see it being a pain while migrating to Adonis. Thanks for any feedback!
thetutlage commented 2 years ago

Added in https://github.com/adonisjs/drive-s3/commit/208e5bbc9e316317424957eb5122ef1cbddb19f0