Question

Difficulty: MediumAPI Development and Integration with Amazon API Gateway

A developer needs to expose a public HTTP endpoint that allows mobile clients to send telemetry data directly to an Amazon SQS queue. To minimize latency, cost, and maintenance, the developer wants to avoid using custom compute resources such as AWS Lambda functions for processing the requests. Which integration type and configuration in Amazon API Gateway should the developer choose to meet these requirements?

  1. A
    An HTTP Proxy integration, setting the endpoint URL to the Amazon SQS queue endpoint, and requiring clients to send requests that match the SQS Query API protocol.
  2. An AWS Service integration, specifying Amazon SQS as the backend service, setting the Action to SendMessage, and using an integration request mapping template to format the client payload.Answer
  3. C
    A Lambda Proxy integration that routes requests to a Lambda function, which then executes the AWS SDK to call the SendMessage API.
  4. D
    A custom Lambda authorizer configured to validate the payload structure and directly route the payload to the SQS queue.

Answer

An AWS Service integration, specifying Amazon SQS as the backend service, setting the Action to SendMessage, and using an integration request mapping template to format the client payload.
The correct choice is to use an AWS Service integration. API Gateway natively supports direct integration with other AWS services. By setting SQS as the backend, specifying the SendMessage action, and using VTL mapping templates, API Gateway can transform incoming JSON client payloads into the query string format required by the SQS SendMessage API. This bypasses the need for an intermediate Lambda function entirely.

Step-by-Step Solution

1
Analyze the backend integration constraints.
The solution must integrate API Gateway directly with Amazon SQS without using custom compute resources (like Lambda functions) to minimize cost, maintenance, and latency.
This rules out Lambda Proxy integrations.
2
Evaluate API Gateway integration types.
Identify that AWS Service integration is the native mechanism in API Gateway to interact directly with other AWS services.
This allows API Gateway to call the SQS API directly.
3
Configure the request transformation.
Use an integration request mapping template (VTL) to map the incoming JSON telemetry payload to the required SQS SendMessage format.
The client application does not need to know the SQS-specific protocol details.

Key Concept

AWS Service Integration in Amazon API Gateway
Estimated Time:1m 30s
Rate this question