feat: add support for S3 IntelligentTiering events#7954
Open
oyiz-michael wants to merge 4 commits intoaws-powertools:developfrom
Open
feat: add support for S3 IntelligentTiering events#7954oyiz-michael wants to merge 4 commits intoaws-powertools:developfrom
oyiz-michael wants to merge 4 commits intoaws-powertools:developfrom
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.