API gateway to SQS

By introducing the SQS queue in front of Lambda, you create an asynchronous connection between the API request and Lambda. This allows you to satisfy the API request without regard for how long the Lambda function (or other backend services) will run.  This will prevent data loss.

Console set up API Gateway to SQS.

Cloudformation blog

Gist – note, don’t really need proxy.

This is the buttom line connection rest api to sqs:  Queue path is account id/queue name

  credentials: !GetAtt ApiGatewayToSQSRole.Arn
  httpMethod: "POST"
  uri: !Sub "arn:aws:apigateway:${AWS::Region}:sqs:path/${AWS::AccountId}/${QueueName}"

AWS documentation