Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions pkg/handler/forwarder/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,33 @@ func TestObjectCreated(t *testing.T) {
},
},
},
{
// eventVersion 2.5: AWS added awsGeneratedTags to s3.bucket for
// CloudFormation-managed buckets (Jul 16, 2026). Verify the SQS/SNS
// S3 notification path handles this field without dropping the record.
Message: `{
"messageId": "00000000-0000-0000-0000-000000000099",
"receiptHandle": "fake",
"body": "{\"Type\":\"Notification\",\"MessageId\":\"00000000-0000-0000-0000-000000000001\",\"TopicArn\":\"arn:aws:sns:us-east-1:123456789012:s3-events\",\"Subject\":\"Amazon S3 Notification\",\"Message\":\"{\\\"Records\\\":[{\\\"eventVersion\\\":\\\"2.5\\\",\\\"eventSource\\\":\\\"aws:s3\\\",\\\"awsRegion\\\":\\\"us-east-1\\\",\\\"eventTime\\\":\\\"2026-07-24T14:00:00.000Z\\\",\\\"eventName\\\":\\\"ObjectCreated:Put\\\",\\\"userIdentity\\\":{\\\"principalId\\\":\\\"AWS:EXAMPLE\\\"},\\\"requestParameters\\\":{\\\"sourceIPAddress\\\":\\\"1.2.3.4\\\"},\\\"responseElements\\\":{\\\"x-amz-request-id\\\":\\\"EXAMPLE\\\",\\\"x-amz-id-2\\\":\\\"EXAMPLE\\\"},\\\"s3\\\":{\\\"s3SchemaVersion\\\":\\\"1.0\\\",\\\"configurationId\\\":\\\"myNotification\\\",\\\"bucket\\\":{\\\"name\\\":\\\"my-bucket\\\",\\\"ownerIdentity\\\":{\\\"principalId\\\":\\\"A21JCN1A8EHLG1\\\"},\\\"arn\\\":\\\"arn:aws:s3:::my-bucket\\\",\\\"awsGeneratedTags\\\":{\\\"aws:cloudformation:stack-name\\\":\\\"my-stack\\\"}},\\\"object\\\":{\\\"key\\\":\\\"test.json\\\",\\\"size\\\":42,\\\"eTag\\\":\\\"abc\\\",\\\"sequencer\\\":\\\"ABC\\\"}}}]}\",\"Timestamp\":\"2026-07-24T14:00:01.000Z\",\"SignatureVersion\":\"1\",\"Signature\":\"FAKE==\",\"SigningCertUrl\":\"https://sns.us-east-1.amazonaws.com/cert.pem\",\"UnsubscribeUrl\":\"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe\"}",
"attributes": {
"ApproximateReceiveCount": "1",
"SentTimestamp": "1721829601000",
"SenderId": "AIDAEXAMPLE",
"ApproximateFirstReceiveTimestamp": "1721829601001"
},
"messageAttributes": {},
"md5OfBody": "",
"eventSource": "aws:sqs",
"eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:my-queue",
"awsRegion": "us-east-1"
}`,
Expected: []forwarder.CopyRecord{
{
URI: "s3://my-bucket/test.json",
Size: pointerToInt64(42),
},
},
},
}

for i, tc := range testcases {
Expand Down
7 changes: 4 additions & 3 deletions vendor/github.com/aws/aws-lambda-go/events/s3.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These vendored files are supposed to mirror our dependencies. Since the upstream aws/aws-lambda-go hasn't added this yet, then the next time someone runs go work vendor this will be lost. I think we should either:

  1. wait for this to get this merged/released upstream (looks like there is a PR for this here: fix(s3event): Add missing awsGeneratedTags field. aws/aws-lambda-go#635)
  2. reference the branch with the fix in our go mod file

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading