fix(s3): adjust SQS bucket notification timestamp format#10032
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10032 +/- ##
==========================================
+ Coverage 93.21% 93.22% +0.01%
==========================================
Files 1328 1329 +1
Lines 120736 120999 +263
==========================================
+ Hits 112541 112799 +258
- Misses 8195 8200 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Ah, apologies for vagueness. It was a discovered via downstream expectation when using motoserver! Specifically, I was using moto for an integration test w/ Vector's S3 source (which uses SQS bucket notifications). The Rust type's deserializer is strict and refuses unless it's got the // https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct S3Event {
pub records: Vec<S3EventRecord>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct S3EventRecord {
pub event_version: S3EventVersion,
pub event_source: String,
pub aws_region: String,
pub event_name: S3EventName,
pub event_time: DateTime<Utc>,
pub s3: S3Message,
} |
Fix S3 bucket notifications for SQS messages to have timestamps in the exactly format expected by AWS.
This is mentioned in the AWS docs1 (already linked in the source):
In moto terms, this is our friend
iso_8601_datetime_with_milliseconds