Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish message from SNS to kinesis

I have requirement to publish messages from SNS to kinesis. I have found that, it is not possible directly by subscribing same as SNS/SQS. I will need to write lambda to fetch from SNS and publish it to kinesis. Is there any other way to publish records from SNS to kinesis directly? Thanks

like image 718
user3462649 Avatar asked May 21 '18 13:05

user3462649


2 Answers

Good news! As of January 2021, Amazon SNS has added support for message archiving and analytics via Kinesis Data Firehose subscriptions. You can now load SNS messages into S3, Redshift, Elasticsearch, MongoDB, Datadog, Splunk, New Relic, and more. The SNS documentation has the details.

like image 182
Otavio Ferreira Avatar answered Oct 01 '22 21:10

Otavio Ferreira


Amazon SNS is a publish/subscribe model.

Messages sent to SNS can be subscribed from:

  • http/s: delivery of JSON-encoded message via HTTP POST
  • email: delivery of message via SMTP
  • email-json: delivery of JSON-encoded message via SMTP
  • sms: delivery of message via SMS
  • sqs: delivery of JSON-encoded message to an Amazon SQS queue
  • application: delivery of JSON-encoded message to an EndpointArn for a mobile app and device.
  • lambda: delivery of JSON-encoded message to an AWS Lambda function.
  • Other options: See Otavio's answer below!

See: Subscribe - Amazon Simple Notification Service

Of these, the only ones that could be used to send to Amazon Kinesis would be to use AWS Lambda. You would need to write a Lambda function that would send the message to a Kinesis stream.

To clarify: Your Lambda function will not "fetch from SNS". Rather, the Lambda function will be triggered by SNS, with the message being passed as input. Your Lambda function will then need to send the message to Kinesis.

Your only other alternative is to change the system that currently sends the message to SNS and have it send the message to Kinesis instead.

like image 29
John Rotenstein Avatar answered Oct 01 '22 20:10

John Rotenstein