Jonathan Wareham
Jonathan Wareham

Reputation: 3397

AWS S3 - Generate presigned URL using REST API

Is it possible to generate a presigned URL for an S3 object using the AWS REST API rather than the SDKs? I can't find the topic for this in the AWS REST API documentation.

Upvotes: 10

Views: 11186

Answers (2)

Joshua Dixon
Joshua Dixon

Reputation: 20

I disagree with the first answer.

You can generate Pre-SignedURL with lambda functions connected to your POST request. Go to Boto3 library and search Pre-signed URL and you can get the code. When a bucket and key is send back to the API Gateway, A Pre-SignedURL is generated. You can also generate Binary Images.

Upvotes: -1

Jason Rosendale
Jason Rosendale

Reputation: 821

You won't find a REST endpoint for generating a presigned URL because that URL is generated entirely client-side. :) The python code used to generate those URLs can be found in the generate_presigned_url method of the signers.py in the botocore library.

You can verify the client-sidedness of the presigned-url generation in two ways:

  1. Grab a network traffic analyzer and compare the traffic of a bucket-list operation and a generate-presigned-url operation

  2. Generate a presigned-url for a non-existent bucket using invalid credentials and marvel as a totally non-fucntional presigned url is still happily generated for you

Upvotes: 16

Related Questions