-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3: Adding notification for eventbridge #7252
S3: Adding notification for eventbridge #7252
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7252 +/- ##
========================================
Coverage 95.88% 95.88%
========================================
Files 843 843
Lines 82578 82699 +121
========================================
+ Hits 79178 79299 +121
Misses 3400 3400
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great @tsugumi-sys - just got a few minor comments.
try: | ||
from moto.events.models import events_backends | ||
|
||
event = copy.deepcopy(_BASE_EVENT_MESSAGE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _BASE_EVENT_MESSAGE
-import should also be local
moto/s3/notifications.py
Outdated
"key": key.name, | ||
"size": key.size, | ||
"eTag": key.etag.replace('"', ""), | ||
"version-id": "IYV3p45BT0ac8hjHg1houSdS1a.Mro8e", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use key.version_id
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks great - thank you @tsugumi-sys!
This is now part of moto >= 5.0.2.dev24 |
Implement S3 EventBridge notification.
put_object
notification.Document of EventBridge event message structure: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ev-events.html
Document of EventBridge notification: https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html