-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(lambda): Improve FilterCriteria
documentation
#23214
Comments
@marciocadev this feature you implemented is wonderful, is there any chance you can work on explaining how it works and updating the existing example? |
Sure, I will update the docs |
@peterwoodworth import * as eventsources from '@aws-cdk/aws-lambda-event-sources';
import * as dynamodb from '@aws-cdk/aws-dynamodb';
declare const fn: lambda.Function;
const table = new dynamodb.Table(this, 'Table', {
partitionKey: {
name: 'id',
type: dynamodb.AttributeType.STRING,
},
stream: dynamodb.StreamViewType.NEW_IMAGE,
});
fn.addEventSource(new eventsources.DynamoEventSource(table, {
startingPosition: lambda.StartingPosition.LATEST,
filters: [lambda.FilterCriteria.filter({ eventName: lambda.FilterRule.isEqual('INSERT') })],
})); but in the documentation the filters line is like this @TheRealAmazonKendra can you help us to update this doc ? |
@marciocadev thanks for noticing this, it turns out we fixed this example specifically here #23085, we just haven't had a release since so I didn't notice this got fixed. My bad 😅 Regardless, are you still interested in writing up a little bit of documentation on how |
Since the example got fixed I think we can remove the bug label? And leave this open for improving the |
FilterCriteria
documentation
Describe the bug
The documentation here leads to a malformed template for EventSource filters
Expected Behavior
I expect the code in the docs to work, and if it doesn't, I expect to have a good enough understanding to work around the limitation in the example.
Current Behavior
The code seen here:
will provide this output in CloudFormation
And the example doesn't leave any good hints as to what the right thing to do is
Reproduction Steps
Synthesize the docs
Possible Solution
The correct code is this:
Additional Information/Context
No response
CDK CLI Version
latest
Framework Version
No response
Node.js Version
16
OS
mac
Language
Typescript
Language Version
No response
Other information
We need to explain how to implement different kinds of filters, rather than just providing an example
The text was updated successfully, but these errors were encountered: