2

I am working on a project to build a backend serverless web api. After reading those documents on AWS api gateway/lambda developer guide, I am totally confused by different methods that I can use.

I am very new to all the web stuff including request, response, proxy, ...

I've tried some solutions I found both on tutorials and online but still confused.

  1. On API Gateway Integration Request, under Integration Type, there are "Lambda function" and "AWS service" , if I choose AWS service, then I can still choose lambda. What is the difference? If I choose lambda, I can choose "use lambda proxy integration", I researched "proxy" and I think I got the idea, but I still feel very confused here. In my experiment, I can get the request inside the "event" object only if I choose "use lambda proxy integration". Sometimes the web browser can render the response coming from the lambda, and sometimes it requires some set up inside the API gateway

  2. What is the best solution/practice to use in my case?

Please help

3 Answers 3

3

AWS Service is for calling the AWS API for that service. Lambda function is for calling a Lambda function. If you want to call the Lambda function, and not call some AWS API related to administering your Lambda functions, then choose integration type "Lambda function".

You second question is so broad I don't even know what you are asking.

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

3 Comments

@Pano: in addition to the info Mark provided, the "lambda proxy integration" is an option if you want a single Lambda function to receive requests from multiple HTTP methods (GET, PUT, DELETE etc.) and multiple paths using the /{proxy+} resource path (this captures any path under the root path). In this option your Lambda function would receive a standard message format for any request containing all of the HTTP info (method, path, headers etc.). You would then determine how to process the request (basically implementing your own routing).
A standard "Lambda function" integration request is more appropriate if you want API Gateway to act as the router for your HTTP methods with different HTTP paths and methods routed to different Lambda functions.
They are both valid ways to implement a serverless API and the architectural decision will come down to how you want to handle routing, deployments, Lambda functions (do you want to use multiple languages for different methods?) etc.
2

Try Claudia.js It maybe the only tool you need. Try also BST Proxy. It has a nifty proxy for local debugging.

Comments

2

I would like to let you know the serverless key points.

  • AWS API Gateway works as a proxy and It can be access directly to third party clients.

  • AWS Lambda function works like an EC2 in a private subnet.

Since AWS Lambda cannot be access directly by third party clients, so you need an AWS API Gateway as a proxy to AWS Lambda function.

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.