In this blog post, I will be walking through the steps as to how we can utilize the presigned url feature to upload files into AWS S3.  Serverless will be used to spin up the necessary AWS resources for this post.

Why do we need a Presigned URL in the first place?

Presigned URL can be used in an instance such as the customer/user wants to upload a file into an S3 bucket, of which he/she doesn’t have access privileges to do so. Hence this mechanism can be used as a secured way of allowing unauthorized users to perform upload/download, into or from S3. This releases the burden from the user’s perspective of having the AWS Credentials (accesskey + secretkey) in place to make the request. Presigned URL also comes with an expiration date and time, hence it can be used more than once till it burns out.

Prerequisites:

AWS CLI and Serverless must be configured. You can follow  this if you haven’t set it up already.

AWS Resources that we’ll need:

  • an S3 Bucket
  • an AWS Lambda Function
  • an API Gateway endpoint

#aws #aws-lambda #s3 #serverless

Use Presigned URL to upload files into AWS S3
1.85 GEEK