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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则