-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Make EventBridge EventPattern support content filtering (#6184) #6414
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
Conversation
|
Title does not follow the guidelines of Conventional Commits. Please adjust title before merge. |
1e20493 to
3015f87
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
3015f87 to
e923cfa
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
e923cfa to
c94cc2c
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
| * Matches event based attribute value. | ||
| * @param values possible values to match the event attribute against | ||
| */ | ||
| public static match(...values: string[]): any[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively instead of prefixing each method with match I was thinking about using just the matcher name.
This way matchPrefix() would become prefix(), matchAnythingBut() would be anythingBut() and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you rename the class as well, I think Match.prefix() would look pretty neat.
| * @default - No filtering on version | ||
| */ | ||
| readonly version?: string[]; | ||
| readonly version?: any[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The big question is whether this is a backward compatible change across all CDK supported languages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it will be. We probably shouldn't be doing this.
A solution is to use Tokens to force the output of the matcher functions to strings.
| /** | ||
| * Event Pattern matcher. | ||
| */ | ||
| export abstract class Matcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other option instead of introducing dedicated factory class is to include this functionality as part of EventPattern type.
| * Matches event based on presence or absence of attribute. | ||
| * @param value whether the attribute should exist or not | ||
| */ | ||
| public static matchExists(value: boolean): any[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does CDK's jsii allows to define default values for parameters? Like in this case value: boolean = true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…aws#6184) Adds dedicated EventPattern factory methods for building the pattern.
c94cc2c to
d439d18
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
| * @default - No filtering on version | ||
| */ | ||
| readonly version?: string[]; | ||
| readonly version?: any[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it will be. We probably shouldn't be doing this.
A solution is to use Tokens to force the output of the matcher functions to strings.
| * Matches event based attribute value. | ||
| * @param values possible values to match the event attribute against | ||
| */ | ||
| public static match(...values: string[]): any[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you rename the class as well, I think Match.prefix() would look pretty neat.
| * Matches event based on presence or absence of attribute. | ||
| * @param value whether the attribute should exist or not | ||
| */ | ||
| public static matchExists(value: boolean): any[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does.
|
Once all the requested changes have been addressed, and the PR is ready for another review, remember to dismiss the review. |
|
Hi @jmnarloch are you going to be working on this or is it dead. |
924c117 to
ebfd5f2
Compare
|
This PR has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
Summary
This is initial code review for supporting the EventBridge Content Filtering capabilities.
Issue: #6184
Highlights:
[]any.