We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da25083 commit ff1bafaCopy full SHA for ff1bafa
aws_lambda_powertools/utilities/parser/models/s3.py
@@ -103,8 +103,10 @@ class S3RecordModel(BaseModel):
103
def validate_s3_object(cls, values):
104
event_name = values.get("eventName")
105
s3_object = values.get("s3").get("object")
106
- if "ObjectRemoved" not in event_name and (s3_object.get("size") is None or s3_object.get("eTag") is None):
107
- raise ValueError("S3Object.size and S3Object.eTag are required for non-ObjectRemoved events")
+ if ":Delete" not in event_name and (s3_object.get("size") is None or s3_object.get("eTag") is None):
+ raise ValueError(
108
+ "Size and eTag fields are required for all events except ObjectRemoved:* and LifecycleExpiration:*.",
109
+ )
110
return values
111
112
0 commit comments