-
Notifications
You must be signed in to change notification settings - Fork 127
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
User Provided S3 Config #240
User Provided S3 Config #240
Conversation
Hey @chrisowebb Thanks for opening this PR, you're awesome! Great feature! I'm currently on vacation until Tuesday+- Will be able to check this more thoroughly then. |
hey, @naorpeled thanks for the response. Have you had a chance to look at this yet ? 😄 |
My plan is to try it out today 😎 |
lib/s3-service.js
Outdated
exports.setClient = (config) => (exports.client = new S3Client(config)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo, in order to not making a breaking change,
we should not remove the ``exports.client = new S3Client()``` above.
Wdyt?
Also, regarding naming of setClient,
maybe we should rename to setConfig or overrideConfig because we're not passing a client, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points, totally agree. I have made updates to reflect this 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😎
I wonder whether we can implement setConfig without creating a new instance of the client.
Honestly it's probably not super crucial but just a thought.
Anyways, thanks for this, you rock!
Will merge and release this tomorrow 🙏 |
Allow user to provide configuration for S3 on api init
User may want to change the config of the client for s3. One example of this is during local dev, to change endpoint etc.
I think the only way to currently do this, is to import the client from lambda-api/lib/s3-service.js and override it?
I think it might be a nicer user experience to be able to provide the config on api init. 😄