Event bridge rule for specific file in the specific path of S3 bucket

0

Can we have event bridge rule for specific file in the specific path of S3 bucket instead of t=just path.

Like S3://sourcebucket123/config/remote123.xlsx

asked 2 months ago120 views
1 Answer
1

Hello.

I think it would be best to create an EventBridge event rule in the following format.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/ev-events.html

{
  "source": ["aws.s3"],
  "detail-type": ["Object Created"],
  "detail": {
    "bucket": {
      "name": ["s3-bucket-name"]
    },
    "object": {
      "key": [{
        "prefix": "test/"
      }]
    }
  }
}
profile picture
EXPERT
answered 2 months ago
  • If it's a specific file, I think you can do it like this:

    {
      "source": ["aws.s3"],
      "detail-type": ["Object Created"],
      "detail": {
        "bucket": {
          "name": ["s3-bucket-name"]
        },
        "object": {
          "key": [{
            "prefix": "config/remote123.xlsx"
          }]
        }
      }
    }
    
  • If it is a specific file, you don't even need the prefix: "key": ["config/remote123.xlsx"]

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions