We are trying to connect API Gateway V2 with API SQS Integration. This integration is working fine and messages are arriving to the queue.
The problem is when we try to add value from header header.sample1
to the message.
Usually the suggested solution is to use Message Attributes in the Integration, but that is not working. In the screenshot below you can see $request.header.sample1
. For this we would expect to receive header value to SQS, but that's not happening and instead the whole API request fails.
We have also tried to format it into object:
{"CUSTOM-ATTRIBUTE-NAME": {"DataType": "String", "StringValue":"felippe"}}
this works fine. But, if I try
{"CUSTOM-ATTRIBUTE-NAME": {"DataType": "String", "StringValue":"$request.header.sample1"}}
this does not work as well. Anything using $request.header
or $request.body
does not work. Also, trying $request.header.sample1
does not work
Follow some images on how we are calling the method.