AWS Lamdba Invoke and forward the request to API path

I have used the AWS lambda plugin to invoke the lambda function before the request is passed on to an API. The Lambda function is getting invoked but the request is not getting forwarded to the API and API is not getting invoked . Do we have add any parameters in the config to forward the request post lambda function invocation to the original API ?

I was also research the Lambda destinations but this my request is simple I have Ingress → Service → application Pod . I have added some additional checks in the Lambda function will need to be invoked before passing the request to Pod and kong Plugin for AWS lambda is working to invoke the lambda function but not passing the request. to the Pod. Any Idea ?

The Lambda plugin replaces the service entirely; it won’t forward it on to the route’s service after processing the request (and in fact Lambda routes shouldn’t have a service assigned at all, since it will never be used).

IMO your options are:

  • Somehow handle this in the Lambda, i.e. pass the upstream service onto it somehow and have it forward the modified request/return the result after forwarding.
  • Fork the Lambda plugin and change its code to use the Lambda response as a modified request for upstream, rather than returning the response immediately.
  • Handle this client-side, and have the client send the Lambda response to a different route that sends it to the upstream service.

Thank you for the reply traines. I was thinking in the same lines but my team thinks that is not the right approach and it defeats the purpose of having Gateway.

© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ