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?
- AAn 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.
- 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
- CA Lambda Proxy integration that routes requests to a Lambda function, which then executes the AWS SDK to call the SendMessage API.
- DA 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
Key Concept
AWS Service Integration in Amazon API Gateway
Estimated Time:1m 30s