Mapping template for API Gateway with SQS integration

Provides a mapping template for API Gateway and SQS integration

These snippets can be used to send and receive messages to an existing SQS queue.
When creating the integration, ensure to have the below configuration to use the mapping template:
1. For Path override the value must be given as '/'
2. The header 'Content-Type' should have the value 'application/x-www-form-urlencoded' (include the single quotes in the value)
3. IAM role with appropriate sns:publish IAM permission for sqs:publish and sqs:receive
4. Select the integration HTTP method as 'POST'

Use the following mapping template to send messages to SQS queue:

Action=SendMessage&MessageBody=$util.urlEncode($input.body)
                                


Use the following mapping template to poll for or retrieve messages from the specified queue:

Action=ReceiveMessage&MaxNumberOfMessages=10&WaitTimeSeconds=10
                                


Created by:

Pallavi Bhat

Pallavi Bhat

Pallavi is a Cloud Support Enginner focusing on serverless at Amazon Web Services.

Follow on LinkedIn