Skip to content

Cannot have multiple S3 event sources on same bucket for same Lambda Function.  #124

@olabhrad

Description

@olabhrad

The following configuration will not work:

event_sources:
- arn: arn:aws:s3:::my-bucket
events:
- s3:ObjectCreated:*
key_filters:
- type: prefix
value: my_path/
- arn: arn:aws:s3:::my-bucket
events:
- s3:ObjectCreated:*
key_filters:
- type: prefix
value: my_path2/

The problem is that Kappa is using the same notification id for both event sources.
def _make_notification_id(self, function_name): return 'Kappa-%s-notification' % function_name

This can be fixed by adding an optional "id" field for the s3 event source that can be utilised if there are more than one event sources on the same bucket e.g.

event_sources:
- arn: arn:aws:s3:::my-bucket
id: 1
events:
- s3:ObjectCreated:*
key_filters:
- type: prefix
value: my_path/
- arn: arn:aws:s3:::my-bucket
id: 2
events:
- s3:ObjectCreated:*
key_filters:
- type: prefix
value: my_path2/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions