1

context

I want to build an API which accepts a file and text parameters together using multipart/form-data. AWS Lambda then performs operations on the file and returns some text. For example

curl -X POST \
  http://my-endpoint.com \
  -F lang=eng \ 
  -F config=text \ 
  -F image=@/home/myfile.jpg
#lang and config are text, image is file. Text is returned

problem

I can build API gateway+lambda or API gateway+S3 APIs. But I'm not getting how to combine them in parallel for the desired effect.

Edit: By parallel I mean one API call starts this sequence-.
POST->save file in S3->read file in lambda->process using passed variables->response

1

1 Answer 1

1

There are a few options here that I can think of.

You can make the lambda function handle the S3 actions for you instead of integrating directly between API Gateway and S3.

Alternatively, you may be able to use web sockets to keep a connection open. The flow would be connect to API (Web socket established) -> POST to API GWAY + API -> s3 put triggers LAMBDA -> Lambda processes and responds via websock.

The first approach may be more achievable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.