S3 integration subscribes to S3 notification and intercept events. The event has the following properties:
eventName
(s3:ObjectCreated:Put
,s3:ObjectCreated:Post
,s3:ObjectRemoved:Delete
, ...)key
- file name
You can not receive file content (it could be gigabytes 🚚). You have to read it yourself.
Basic example:
await serverlessSpyListener.waitForS3MyBucket()
You can use conditions to wait for a particular event.
await serverlessSpyListener.waitForS3MyBucket({
condition: (d) => d.key === `${id}.json`,
})
serverlessSpy.spy({
spyS3: false,
});
Check this test{:target="_blank"}.