Question

Difficulty: MediumAPI Development and Integration with Amazon API Gateway

A developer is designing a REST API using Amazon API Gateway to ingest tracking events. To minimize latency and operating costs, the API must write incoming payloads directly to an Amazon SQS queue without using an intermediate AWS Lambda function. Which two configuration steps must the developer perform in API Gateway to successfully establish this integration? (Select TWO.)

  1. Configure the integration type as AWS Service, select Simple Queue Service (SQS) as the AWS Service, and set the integration HTTP method to POST.Answer
  2. Create an IAM role that grants sqs:SendMessage permissions and specify this role's ARN in the Execution Role field of the integration settings.Answer
  3. C
    Enable Lambda Proxy Integration on the integration settings and specify the target SQS queue ARN.
  4. D
    Configure a Cognito User Pool authorizer on the API method to authorize API Gateway to publish to SQS.
  5. E
    Configure the SQS queue policy to allow CORS requests originating from the API Gateway endpoint.

Answer

The correct configurations are setting the integration type to AWS Service targeting SQS with the POST method, and creating an IAM execution role with the sqs:SendMessage permission for API Gateway.
To integrate API Gateway directly with SQS, you must use the AWS Service integration type with the POST method. Additionally, API Gateway requires an IAM execution role to authorize the sqs:SendMessage action on the SQS queue.

Step-by-Step Solution

1
Define the backend integration type.
Choose AWS Service integration, specify SQS, and set the HTTP method to POST to use the SendMessage action.
This establishes a direct API Gateway-to-AWS service communication bypass without using a Lambda function.
2
Configure the IAM permissions.
Provide an IAM Execution Role with sqs:SendMessage permission in the integration setup.
API Gateway needs to assume an IAM role that has authorization to write to the specified SQS queue.

Key Concept

API Gateway direct integration with AWS Services bypassing Lambda
Rate this question