AWS API-Gateway communicating to SNS

后端 未结 7 806
暗喜
暗喜 2020-12-29 06:13

I am building an API which will be serviced by Lambda functions but I need these to be asynchronous so rather than connecting the API-Gateway directly to the Lambda function

7条回答
  •  天涯浪人
    2020-12-29 06:25

    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
    

提交回复
热议问题