5
votes

I have integrated a API Gateway with FIFO SQS queue using below link https://medium.com/@pranaysankpal/aws-api-gateway-proxy-for-sqs-simple-queue-service-5b08fe18ce50

Below is the snippet of role policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "sqs:SendMessageBatch",
                "sqs:ReceiveMessage",
                "sqs:SendMessage"
            ],
            "Resource": "arn:aws:sqs:*:12345678:Stg"
        }
    ]
}

Whenever is try to test it from API Gateway it throws below error:- "Message": "The request must contain the parameter MessageGroupId."

So I tried to send it via query string but still the error persist.

I have followed the same steps as per the above link for body template and header.

MessageGroupId=098

Simply passing above value in query string and body is below

{"ty":"ui"}
1
Can you put the whole code you are using? - Ricardo Albear
There is no code. My Api Gateway is unable to send message to SQS wit the provided error:- "Message": "The request must contain the parameter MessageGroupId." - Abhishek Kumar

1 Answers

9
votes

You need to add MessageGroupId, and MessageDeduplicationId to the URL Query String Parameters in Method Execution. Same way you did for MessageBody.

You'll also need to add MessageGroupId, and MessageDeduplicationId to Integration Request. Again the same way you did with MessageBody.