rzlvmp
rzlvmp

Reputation: 9364

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.

Upvotes: 1

Views: 2390

Answers (1)

David Brabant
David Brabant

Reputation: 43459

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

s3 = boto3.resource('s3')
url = s3.meta.client.generate_presigned_url(...)

Upvotes: 5

Related Questions