generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 454
Closed
Labels
bugSomething isn't workingSomething isn't workingtriagePending triage from maintainersPending triage from maintainers
Description
Expected Behaviour
In the class S3EventBridgeNotificationObject located in aws_lambda_powertools.utilities.data_classes.s3_event.py the property "version_id" should return self["version_id"]
Current Behaviour
In the class S3EventBridgeNotificationObject located in aws_lambda_powertools.utilities.data_classes.s3_event.py the property "version_id" IS returning self["version-id"] , which does not exist
Code snippet
**Example EB Event from S3:**
`{'account': '1111111111', 'detail': {'bucket': {'name': 'bucket-name', 'raw_event': '[SENSITIVE]'}, 'deletion_type': None, 'destination_access_tier': None, 'destination_storage_class': None, 'object': {'etag': '145bba459f6e8ffd091a05c9ae703693', 'key': 'object-key', 'raw_event': '[SENSITIVE]', 'sequencer': '0068385E251A75725B', 'size': 1167240, 'version_id': '[Cannot be deserialized]'}, 'raw_event': '[SENSITIVE]', 'reason': 'PutObject', 'request_id': '2X0DAA9HWH8M26PB', 'requester': '11111111111', 'restore_expiry_time': None, 'source_ip_address': '########', 'source_storage_class': None, 'version': '0'}, 'detail_type': 'Object Created', 'get_id': 'b7c6d31d-677d-b716-7604-ca913407ed14', 'raw_event': '[SENSITIVE]', 'region': '#########', 'replay_name': '[Cannot be deserialized]', 'resources': ['arn:aws:s3:::bucket-name'], 'source': 'aws.s3', 'time': 'datetimestampZ', 'version': '0'}`
Possible Solution
Change line 52 in aws_lambda_powertools.utilities.data_classes.s3_event.py to return self["version_id"]
Steps to Reproduce
Pass an EventBridge S3 Object Event formatted dict to the S3EventBridgeObjectNotifcationEvent class and then try to reference event.detail.object.version_id.
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.12
Packaging format used
PyPi
Debugging logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriagePending triage from maintainersPending triage from maintainers
Type
Projects
Status
Coming soon