How to get amazon SNS when a large file is uploaded to a S3 folder

Viewed 31

I was able to set up an SNS notification for a specific file type in a folder on Amazon S3 but I want to restrict the notification emails to be sent only when the file size is bigger than 90MB.

How will I do that?

1 Answers

I was able to do it with Amazon EventBridge by creating a new rule and adding this Event pattern and linking it to my SNS topic

{
  "source": ["aws.s3"],
  "detail-type": ["Object Created"],
  "detail": {
    "bucket": {
      "name": ["BUCKETNAME"]
    },
    "object": {
      "size": [{
        "numeric": [">=", 90000000]
      }],
      "key": [{
        "prefix": "folderPath"
      }]
    }
  }
}

Related