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 Respuestas
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
EXPERTO
respondido hace 9 meses
  • 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
EXPERTO
Steve_M
respondido hace 9 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas