REST API Integration: AWS Certified Developer - Associate | Exam Question Answer

Integrating REST API: AWS Certified Developer - Associate Exam Question Answer

Prev Question Next Question

Question

You are working on a REST API where you require to pass client submitted method requests as it is to a Lambda Function.

Which of the following can be set as an Integration type for this requirement?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - A.

Integration Type “Aws_Proxy” can be used for an API method to be integrated with the Lambda Function where incoming requests from the clients are passed as input to Lambda Function.

Option B is incorrect with AWS integration.

There is a mapping between method request & integration request along with method response & integration response.

This is not a suitable integration type for passing client requests to the Lambda function directly.

Option C is incorrect as the "http_proxy" integration allows clients to access backend HTTP endpoints.

This is not a suitable integration type for passing client requests to the Lambda function directly.

Option D is incorrect as mock integration type is used to test integration type with API Gateway sending response without sending request to backend.

For more information on choosing API Gateway API Integration type, refer to the following URL-

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-integration-types.html

The correct answer for this question is A. "type": "aws_proxy".

When creating a REST API in Amazon API Gateway, you have several integration types to choose from, which determine how requests are routed from the API Gateway to your backend service.

  • "aws_proxy": This integration type is used to integrate with Lambda functions. When you select this option, the API Gateway will pass the entire request to the backend Lambda function as is, without any modifications. This means that the Lambda function will receive the same method request that was submitted by the client. This integration type is useful if you want to offload your API's logic to a Lambda function and don't want to perform any processing on the request before it reaches the Lambda function.

  • "aws": This integration type is also used to integrate with Lambda functions, but it requires you to define the mapping between the incoming request and the format expected by the backend Lambda function. This can be useful if you want to transform the request before it reaches the Lambda function, for example, to extract parameters or headers from the request and pass them as input to the Lambda function.

  • "http_proxy": This integration type is used to integrate with HTTP or HTTPS endpoints. When you select this option, the API Gateway will forward the request to the backend endpoint using the same method and headers as the incoming request. This integration type is useful if you have an existing HTTP endpoint that you want to expose through an API Gateway.

  • "mock": This integration type is used for testing purposes only. It allows you to create a mock backend for your API, which will return predefined responses to requests without actually invoking any backend service.

In this case, the requirement is to pass the client submitted method requests as is to a Lambda function, which means that we don't want to modify the request in any way before it reaches the backend Lambda function. The "aws_proxy" integration type is the best fit for this requirement, as it will pass the entire request to the Lambda function without any modifications.