Connecting AWS API Gateway to SQS

in Cloud & Serverless


An outline, leaving out the defaults and the obvious chores such as selecting the right region: 1. Create your SQS queue 2. Create a REST API, a resource and a method - Method Request: empty, no auth - Integration Request: - Type: AWS Service - AWS Service: Simple Queue Service (SQS) - AWS Subdomain: (empty) - HTTP method: POST - Path override: (Account ID)/(Queue Name) - Execution role arn:aws:iam::(Account ID):role/(Role Name) - HTTP Headers - Add `Content-Type` with `'application/x-www-form-urlencoded'` (including the single quotes) - Mapping Templates - Request body passthrough: Never - Add mapping template: `application/json` with `Action=SendMessage&MessageBody=$input.body.replaceAll('\n', '')` Here's `util` reference
#aws #aws-apigateway #aws-sqs