S3 bucket put operation SNS notification

0

I sent out an notification whenever an automated Jenkins build job uploads one or more documents to a specific bucket. It may dump upto 9 documents weekly once at the same time. I want to notify only once rather 9 times. How would I achieve it? I can send out notification via a Lambda function, but how do I make it work?

2 個答案
2

Instead of using SNS, why not use SQS as the notification path? You'll still get (say) nine notifications but you can trigger a build at a specific time during the week and then get all nine notifications from SQS at the same time.

profile pictureAWS
專家
已回答 9 個月前
  • I want to send out only one email. Moreover for a simple thing why SQS?

  • You can have a script/Lambda that queries the SQS queue; gathers all the waiting messages and then sends a single email.

0

If you can filter by the by the prefix and suffix of the object name to only match one of the nine objects then you may be able to (in effect) ignore the other eight https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html

Otherwise, if all nine objects will be uploaded within a 15 minute period then a lambda function would suit this use case - either send an email when the first object is uploaded to the bucket and do nothing for objects 2 to 9; or do nothing for objects 1 to 8 and send an email when object 9 appears.

If the time from first to last could be more than 15 minutes then consider using a step function.

profile picture
專家
Steve_M
已回答 9 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南