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

Allow to pass boto3 client to S3Client #435

Open
abourramouss opened this issue May 7, 2024 · 2 comments
Open

Allow to pass boto3 client to S3Client #435

abourramouss opened this issue May 7, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@abourramouss
Copy link

abourramouss commented May 7, 2024

Currently the S3Client needs the credentials to be used, but what happens if i already have a boto3 client somewhere initialized and i want to use the S3Client class?

Is it possible to allow for the S3Client to take a boto3 client that has already been created? It would be simply passing the client at the constructor

@pjbull
Copy link
Member

pjbull commented May 8, 2024

I think it should be possible. It may also require that you pass the session as well (which we currently support).

Out of curiosity, what is the scenario where you already have a client? What parameters are you using in constructing the client that you can't use with the current instantiation approach?

@abourramouss
Copy link
Author

abourramouss commented May 8, 2024

Out of curiosity, what is the scenario where you already have a client? What parameters are you using in constructing the client that you can't use with the current instantiation approach?

I use the Lithops framework to execute serverless functions. Lithops has a storage class, and this storage class is just a wrapper around boto3, Lithops exposes a get_client from whom i could get the boto3 client.

The idea of course is that Lithops has it's own config file and from where initializes everything, and to not pass the credentials through the code, it would be interesting to initialize the S3Client with the boto3 client.

https://github.com/lithops-cloud/lithops/

@pjbull pjbull added the good first issue Good for newcomers label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants