Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to generate S3 presigned URL with boto3 resource instead of client

I trying refactor application that using s3 = boto3.resource('s3') (what is resource) as S3 instance.

But only Client class has the generate_presigned_url method. So, how can I get presigned URL with resource?

In the internet many examples and examples how to get presigned URL with client but nothing with resource.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can access the client associated to the resource this way:

s3 = boto3.resource('s3')
client = s3.meta.client.generate_presigned_url(...)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading