Reputation: 41
I have a process which will load all files to an S3 bucket. I subscribed(SNS) to the bucket which triggers an email for each file. However, my process is loading over a 10000 files everyday.
What is the best way to summarize and just have one email notification(at a certain time of the day) with total files uploaded. Also, send an email when no files are received by that time?
Upvotes: 0
Views: 999
Reputation: 32081
You shouldn't do a list bucket operation daily, that would be wasteful on a large bucket, use the S3 inventory to generate the daily inventory then either compare against the previous day or use the timestamps in the CSV.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html
Upvotes: 1
Reputation: 269548
You should schedule a daily run of an AWS Lambda function that will:
LastModified
within the previous 24 hoursIf the bucket is receiving 10,000+ objects each day, it can take a considerable time to list the contents of the bucket. Make sure the Lambda function has a suitably high timeout since it can only list 1000 objects per API call.
Upvotes: 0