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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠