-
Notifications
You must be signed in to change notification settings - Fork 467
feat(event_source): add support for S3 IntelligentTiering events #7954
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
feat(event_source): add support for S3 IntelligentTiering events #7954
Conversation
Relates to aws-powertools#7443 S3 IntelligentTiering events use a different structure than standard S3 events - they use 'get_object' as the key name instead of 'object' in the S3 message, and include 'intelligentTieringEventData' field. Changes: - Add S3EventRecordIntelligentTieringEventData model - Update S3Message to support both 'object' and 'get_object' fields - Add intelligentTieringEventData field to S3RecordModel - Update validator to handle both field names
Relates to aws-powertools#7443 Extends S3Event data classes to handle IntelligentTiering events which use 'get_object' key instead of 'object' in the S3 message. Changes: - Add S3EventRecordIntelligentTieringEventData wrapper class - Update S3Message.get_object() to handle both key names - Update S3Event.object_key to handle both key names - Add intelligent_tiering_event_data property to S3EventRecord
Relates to aws-powertools#7443 Add test event and comprehensive test coverage for both parser models and data classes handling of S3 IntelligentTiering events. Changes: - Add s3EventIntelligentTiering.json test event - Add parser model tests (2 tests) - Add data classes tests (3 tests) - Tests verify get_object field handling and intelligentTieringEventData
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7954 +/- ##
========================================
Coverage 96.72% 96.73%
========================================
Files 278 278
Lines 13630 13646 +16
Branches 1084 1084
========================================
+ Hits 13184 13200 +16
Misses 327 327
Partials 119 119 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
leandrodamascena
left a comment
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.
Thanks @oyiz-michael! APPROVED.



Issue number: closes #7443
Summary
Changes
This PR adds support for parsing S3 IntelligentTiering events, which have a different structure than standard S3 events.
Root cause: S3 IntelligentTiering events use
"get_object"as the key name instead of"object"in the S3 message, and include anintelligentTieringEventDatafield with access tier information. The existing models only supported the"object"key, causing parsing failures.Solution: Updated both parser models and data classes to handle both field names, making the implementation backward compatible with all existing S3 event types.
Files changed:
aws_lambda_powertools/utilities/parser/models/s3.py: AddedS3EventRecordIntelligentTieringEventDatamodel, updatedS3Messageto support bothobjectandget_objectfields, and fixed validatoraws_lambda_powertools/utilities/data_classes/s3_event.py: AddedS3EventRecordIntelligentTieringEventDataclass, updatedS3Message.get_object()andS3Event.object_keyto handle both key namestests/events/s3EventIntelligentTiering.json: Added comprehensive test eventtests/unit/parser/_pydantic/test_s3_intelligent_tiering.py: Added parser model tests (2 tests)tests/unit/data_classes/required_dependencies/test_s3_intelligent_tiering_event.py: Added data classes tests (3 tests)User experience
Before:
After
All existing S3 event types continue to work as before - the changes are fully backward compatible.
Testing:
Added 5 new tests covering both parser models and data classes
All 17 S3-related tests pass (5 new + 12 existing)
No regressions in existing S3 event parsing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.