feat(forwarder): add SQS support as event source for S3 notifications#1064
Merged
LorisFriedel merged 5 commits intomasterfrom Feb 13, 2026
Merged
Conversation
Support S3 event notifications delivered via SQS queues (S3 -> SQS -> Lambda and S3 -> SNS -> SQS -> Lambda). The forwarder detects SQS event records, unwraps the inner S3 event from the SQS body, and delegates to the existing S3EventHandler. Each SQS record gets fresh metadata to avoid cross-contamination across batch items. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ge0Aja
reviewed
Feb 12, 2026
ge0Aja
approved these changes
Feb 12, 2026
Contributor
ge0Aja
left a comment
There was a problem hiding this comment.
lgtm, needs a lint check (we're using py3.13) for the moment since cf-lint is not supported in py3.14
Add SqsQueueArnList parameter to optionally restrict SQS IAM permissions to specific queue ARNs, following the same pattern used for S3 bucket restrictions (S3BucketArnList/SetS3BucketArns). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
If an SQS message body is valid JSON but not a dict (e.g. a string, number, or array), _contains_s3_records() would raise AttributeError on .get(), crashing the entire batch. Add an isinstance check to gracefully skip non-object bodies like we already do for malformed JSON. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
S3 -> SQS -> LambdaandS3 -> SNS -> SQS -> Lambda) are correctly parsed and forwarded to DatadogeventSource: "aws:sqs", unwrapped (direct S3 or SNS-wrapped S3), and delegated to the existingS3EventHandlerwith fresh per-record metadatasqs:ReceiveMessage,sqs:DeleteMessage,sqs:GetQueueAttributes) to the CloudFormation templateChanges
steps/enums.pySQStoAwsEventTypeenumsteps/parsing.pyparse_event_type(),sqs_handler,_extract_inner_event_from_sqs,_contains_s3_recordstemplate.yamlForwarderRolePolicy0tests/test_parsing.pytests/events/sqs_s3.jsontests/events/sqs_sns_s3.jsonOBSPLTF-945