A developer is designing a high-throughput REST API using Amazon API Gateway. To minimize latency, operational cost, and code maintenance, the API must place incoming message payloads directly into an Amazon Simple Queue Service (Amazon SQS) queue without utilizing an intermediate AWS Lambda function. Which configuration in API Gateway meets these requirements?
- Configure the API method with an AWS Service integration, select Simple Queue Service (SQS) as the AWS service, set the Action to SendMessage, and configure an IAM execution role with permission to write to SQS.Cevap
- BConfigure the API method with a Lambda proxy integration, and set the integration endpoint directly to the Amazon SQS queue HTTPS URL using the queue-owner credentials.
- CConfigure the API method with a custom Lambda authorizer that receives the payload, validates it, and writes it directly to the SQS queue before returning an IAM policy.
- DConfigure the API method with a mock integration, and use an integration mapping template to forward the payload directly to the SQS endpoint while enabling CORS.
Cevap
Configure the API method with an AWS Service integration, select Simple Queue Service (SQS) as the AWS service, set the Action to SendMessage, and configure an IAM execution role with permission to write to SQS.
The correct answer provides a direct AWS Service integration targeting SQS. Using the AWS Service integration type allows API Gateway to map HTTP requests directly to SQS SendMessage actions, authenticating via an IAM execution role and avoiding the cost, latency, and maintenance of Lambda compute.
Adım Adım Çözüm
Anahtar Kavram
API Gateway AWS Service integration allows direct communication between API Gateway and AWS services (like SQS, DynamoDB, or Kinesis) without a Lambda execution layer, reducing request latency and runtime execution costs.