Golang lambda upload image into s3 static website

38 Views Asked by At

I have an existing go webserver that has a route that accepts form elements (one of which is a file) and uploads the resulting file (after resizing and renaming) into the images folder that the webserver serves up. I am changing the application to use lambda (go) and a static website on s3. Other things like storing the information on MongoDB (aws hosted), I understand completely.

I know that I need to add the PutObject permissions on the website bucket. Again in s3 I have an images folder... Does anyone have an example similar? All the code on the AWS github repo has the file going to the bucket (not a folder in the bucket like images).

Again I need to resize the image (write to /tmp in lambda?), and upload to the folder in the s3 bucket.

Any examples or ideas regarding this would be much appreciated. Thanks in advance.

0

There are 0 best solutions below