Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(s3): fail early with bad notification filters #3397

Merged
merged 1 commit into from
Jul 23, 2019

Conversation

jogold
Copy link
Contributor

@jogold jogold commented Jul 23, 2019

Avoid CF deploy time errors when specifying multiple prefixes or suffixes in notification filters.

Closes #3347


Please read the contribution guidelines and follow the pull-request checklist.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Avoid CF deploy time errors when specifying multiple prefixes or suffixes in notification filters.

Closes aws#3347
@jogold jogold requested a review from a team as a code owner July 23, 2019 12:47
@jogold
Copy link
Contributor Author

jogold commented Jul 23, 2019

Note
The following code:

bucket.addObjectCreatedNotification(
  new notifications.LambdaDestination(notifierFn),
  { prefix: 'a/', suffix: '.txt' }
)

is currently equivalent to:

bucket.addObjectCreatedNotification(
  new notifications.LambdaDestination(notifierFn),
  { prefix: 'a/' }, { suffix: '.txt' }
)

meaning that with the current implementation it makes no sense to have addObjectCreatedNotification() accept ...filters: NotificationKeyFilter[] as last argument.

Should be addressed in a future version to offer a better API allowing something like that:

bucket.addObjectCreatedNotification( // multiple calls to `addObjectCreatedNotifcation` are needed to achieve this today
  new notifications.LambdaDestination(notifierFn),
  { prefix: 'docs/', suffix: '.pdf' },
  { prefix: 'images/', suffix: '.png' }
)

which is breaking... for v2?

How do you guys track changes that are breaking but that could be considered in a future version?

@eladb
Copy link
Contributor

eladb commented Jul 23, 2019

@eladb eladb merged commit cd0e9bd into aws:master Jul 23, 2019
@shellscape
Copy link

@eladb several years on, this continues to cause developer experience pain. it's worth revisiting.

@jogold jogold deleted the s3-notifications-fail branch October 27, 2023 16:42
@eladb
Copy link
Contributor

eladb commented Oct 27, 2023

Agreed, I am just out of the loop at this point :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

S3 notifications with multiple filters not intuitive/error prone
3 participants