Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I persist SNS (or SQS) messages to S3 through given AWS integrations?

I want to save all SNS messages to S3 so I can keep a complete history. The purpose is to have the ability to go look back when diagnosing and issue, later index and use this to audit, replay, rebuild data, etc. For now, I just want to dump them into S3 (cheap) and later I'll dig into it when needed.

  • I don't need to transform or manipulate the data, I can just dump it for now

Can I use AWS provided integrations to accomplish this or do I need to write my own HTTP service or Lambda?

I'd rather not have to write and maintain a lambda or service if I can avoid it.

What I've seen so far is that I can set an HTTP endpoint as an SNS subscriber but it has a different message format than the S3 http api thus requiring a lambda to transform it. Also the initial subscriber confirmation message. Is this not possible and I should get to work on my own service/lambda?

like image 467
Chip Avatar asked Jan 04 '19 00:01

Chip


People also ask

Is AWS SNS persistent?

SNS : No persistence. Whichever consumer is present at the time of message arrival, get the message and the message is deleted. If no consumers available then the message is lost.

Can S3 trigger SNS?

I've used SNS notifications triggered by S3 bucket whenever an object is put on a particular folder in S3. You can follow the below steps to achieve the same: Step 1: Create an Amazon SNS topic for the Email Notifications: First of all, create an Amazon SNS topic which publishes notifications to email.

How long can you keep your Amazon SQS messages in Amazon SQS queues?

You can configure the Amazon SQS message retention period to a value from 1 minute to 14 days. The default is 4 days. Once the message retention quota is reached, your messages are automatically deleted.

Can S3 send notification to SQS?

Sends notifications from S3 to SQS when an object is created. This SAM template creates an S3 bucket and SQS queue. S3 writes a messages to the SQS queue when a new object is put into the bucket.


1 Answers

As far as I know this isn't possible.

It would be pretty trivial to write a lambda which can persist your SNS or SQS messages.

You can also use something like sqs-s3-logger (note this code is based on the fact you couldn't trigger a Lambda from SQS, this is possible now so you don't need a cron job)

like image 144
Nic Avatar answered Oct 15 '22 00:10

Nic