DEV Community

Discussion on: A Lesson Learned In Going Serverless

Collapse
 
iwaduarte profile image
iwaduarte

One of the things that you could consider is configuring your api gateway endpoint. Is just a question of encapsulating the content in a buffer in the s3 side (I have used encoding base64) and treating the http request as a binary media type by putting the tag. "multipart/form-data" in the settings -> media type in the api console (or at least that it is what I did recently to solve the same problem). I do not know if this solution is the best practice either but surely I believe it is the easiest.

Collapse
 
mhausenblas profile image
Michael Hausenblas

Thank you for the follow-up here and your suggestion. Indeed, I've seen this method documented, for example here and looks sensible to me as well as an alternative.

Collapse
 
iwaduarte profile image
iwaduarte

Although it seems like a solution is different from what I did. My request went directly to lambda (via mock not integration at all) and the binary media types setting is just an input text on the api settings section.