'AWS API Gateway concatenate query string parameter

I am trying to have an API Gateway that can publish to multiple SNS and choose which one it publishes to by sending the name of the topic as a header. Then I want to concatenate it to make the TopicArn in the integration request.

For example with a header 'topic' I want to put something like this in 'mapped from':

'arn:aws:sns:xx-xxxx-1:1234567:{method.request.header.topic}'

But that doesn't work. Maybe I should use the mapping but don't know how to do it.

I have tried lots of things but am just stuck. Would love to find a good code example somewhere but any help at all would be appreciated



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source