Home > front end >  How to send S3 object path or URI when an object created event is generated
How to send S3 object path or URI when an object created event is generated

Time:06-06

I am new to AWS, I wanted to get S3 object URI/path when the object creation event is generated. Object can be created anywhere in the bucket, like there can be multiple sub folders that dynamically created in s3 bucket based on the date. So I want to know exactly where object is created. Is there anyway to do so? Seems like most of the message structure examples I can see only object name and bucket name not the entire object URI. I'm planning to use this message to SNS or kinesis streams with eventbridge.

CodePudding user response:

You have to setup S3 Event Notifications for your bucket that will trigger your custom lambda function.

Once the object is uploaded to the bucket, your function is going to get invoked and obtain all the associated data about the event, such as object name, key, bucket, data, etc. Then your lambda may use that information to construct custom messages (entire object URI) that will be then uploaded to SNS or Kinesis.

  • Related