AWS API-Gateway communicating to SNS
I'm from the Api Gateway team.
I believe there are a few formats for the HTTP request to the Publish API, but here's the one I used first:
AWS Region us-west-2
AWS Service sns
AWS Subdomain
HTTP method POST
Action Publish
== query strings ==
Subject 'foo'
Message 'bar'
TopicArn 'arn:aws:sns:us-west-2:xxxxxxxxxxxx:test-api'
This worked for me to publish a message.
Let me know if you have further troubles.
Jack
If anybody is still looking for a solution to the original problem, proxying a JSON request body to an SNS topic via API gateway alone, it's possible.
Create the gateway as Ken describes above. Then simply proxy the body to the Integration Request's query parameters. You can also hard code Subject, TopicArn, etc here, or map those from the request's body using a JsonPath.
For example:
{
//body
"topic": "arn:aws:sns:1234567:topic"
}
Could be mapped to a header as:
method.request.body.topic