garnaat / kappa

What precedes Lambda
http://kappa.readthedocs.org/en/develop/
Apache License 2.0
902 stars 88 forks source link

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

Open olabhrad opened 7 years ago

olabhrad commented 7 years ago

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/
olabhrad commented 7 years ago

PR: #120