This is a simple AWS Lambda function that generates a presigned URL for a file uploaded to S3.
Important
Be shure to follow the instructions bellow in the correct order.
Create a S3 bucket
Define the bucket name in the `src/index.js` file in line 24
Create a lambda function
Zip this repository and upload it to your lambda function
Update the handler path to `aws-lambda-presigned-urls/src/index.handler`
Make a POST request to your function url with the following body:
{
"filename": "test.png"
}
The response will be a JSON object with the presigned URL
Add S3 PutObject policy to your lambda function
Make a PUT request to URL generated in the previous with the file
Important
There is an example of how to access the uploaded file using getPresignedUrl in the src/getPresigned.js
file.