We have created an AWS API Gateway which is integrated to S3 object put. Such that whenever call is made we save the request body in S3. The response is sent back from integration mapping configuration using velocity template language.
Afterwards, from S3 event bridge triggers the lambda invocation.
Now, we want to directly call the lambda if the size of request body is small and return response directly from lambda and keep the above integration if request body is large.
I guess we are looking for something like a dynamic integration for the API Gateway. Is it possible to achieve that ?