amazon-web-servicesamazon-s3aws-lambdaaws-api-gatewayamazon-textract

Return value of the Lambda can be seen by response of API gateway?


I'm trying to implement the following structure on my AWS account. I'll upload a picture to my s3 bucket with a put/post request and process the following picture with Textract. API call for the Textract will be handled by Lamda. So here is the question. Will the response of the lambda be my response to put/post request? I mean when I put/post via API gateway there got to be a response. I'd like to see this response content from Lambda's response. Is it possible by the following structure?

enter image description here


Solution

  • There are two parts here and, in your current diagram, what you want to do isn't possible directly. The S3 to Lambda call is not part of the same flow - it is done for you by AWS and you don't have direct control over it.

    Additionally, it may take some time to do the extraction, depending on the complexity of the documents uploaded. Not hours but not instantaneously either.

    So it will need to change to a disconnected model where the request is sent off and then some time later you either poll for a result or are notified that a result is available.

    Conceptually, more like this:

    enter image description here