Skip to content

Add support for S3-based message for SQS  #171

@nguyenmv2

Description

@nguyenmv2

Is there a plan for adding supports for SQS messages coming from S3 bucket notification?
The structure of the message is different from a typical SQS message ( I've attached an example below )

{
    "Records": [
        {
            "eventVersion": "2.1",
            "eventSource": "aws:s3",
            "awsRegion": "<some region>",
            "eventTime": "2019-02-22T19:39:33.390Z",
            "eventName": "ObjectCreated:Put",
            "userIdentity": {
                "principalId": ""
            },
            "requestParameters": {
                "sourceIPAddress": ""
            },
            "responseElements": {
                "x-amz-request-id": "",
                "x-amz-id-2": ""
            },
            "s3": {
                "s3SchemaVersion": "1.0",
                "configurationId": "<some configuration id>",
                "bucket": {
                    "name": "<bucket>",
                    "ownerIdentity": {
                        "principalId": "<principalId>"
                    },
                    "arn": "arn:aws:s3:::<bucket>"
                },
                "object": {
                    "key": "test/foo.txt",
                    "size": 1016,
                    "eTag": "",
                    "sequencer": "005C704FF558BE1340"
                }
            }
        }
    ]
}

I would love to contribute a PR. However, my solution assumes all messages always come in this format. I wonder if there's a way to dynamically unmarshal structs in Go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions