moto
moto copied to clipboard
S3: Implement EventBridge Notification
Since moto currently supports only Object Created event, let's add the other events described here.
| Event type | Description | PR |
|---|---|---|
| Object Created | An object was created.The reason field in the event message structure indicates which S3 API was used to create the object: PutObject, POST Object, CopyObject, or CompleteMultipartUpload. | PutObject: https://github.com/getmoto/moto/pull/7252, PostObject: https://github.com/getmoto/moto/pull/7368, CopyObject: https://github.com/getmoto/moto/pull/7407, CompleteMultipartUpload: https://github.com/getmoto/moto/pull/7435 |
| Object Deleted (DeleteObject), Object Deleted (Lifecycle expiration) | An object was deleted.When an object is deleted using an S3 API call, the reason field is set to DeleteObject. When an object is deleted by an S3 Lifecycle expiration rule, the reason field is set to Lifecycle Expiration. For more information, see Expiring objects.When an unversioned object is deleted, or a versioned object is permanently deleted, the deletion-type field is set to Permanently Deleted. When a delete marker is created for a versioned object, the deletion-type field is set to Delete Marker Created. For more information, see Deleting object versions from a versioning-enabled bucket. | DeleteObject: https://github.com/getmoto/moto/pull/7420, (deletion by lifecycle expiration is not yet supported in moto?) |
| Object Restore Initiated | An object restore was initiated from S3 Glacier or S3 Glacier Deep Archive storage class or from S3 Intelligent-Tiering Archive Access or Deep Archive Access tier. For more information, see Working with archived objects. | https://github.com/getmoto/moto/pull/7455 |
| Object Restore Completed | An object restore was completed. | https://github.com/getmoto/moto/pull/7455 |
| Object Restore Expired | The temporary copy of an object restored from S3 Glacier or S3 Glacier Deep Archive expired and was deleted. | |
| Object Storage Class Changed | An object was transitioned to a different storage class. For more information, see Transitioning objects using Amazon S3 Lifecycle. | |
| Object Access Tier Changed | An object was transitioned to the S3 Intelligent-Tiering Archive Access tier or Deep Archive Access tier. For more information, see Amazon S3 Intelligent-Tiering. | |
| Object ACL Updated | An object's access control list (ACL) was set using PutObjectACL. An event is not generated when a request results in no change to an object’s ACL. For more information, see Access control list (ACL) overview. | https://github.com/getmoto/moto/pull/8349 |
| Object Tags Added | A set of tags was added to an object using PutObjectTagging. For more information, see Categorizing your storage using tags. | https://github.com/getmoto/moto/pull/7673 |
| Object Tags Deleted | All tags were removed from an object using DeleteObjectTagging. For more information, see Categorizing your storage using tags. | https://github.com/getmoto/moto/pull/7712 |
https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html
I'm working on Object Storage Class Changed event.
working on Object Restore initiated
oh object restore initated and complete are done I guess https://github.com/getmoto/moto/pull/7455
working on restore expired instead