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

DynamoEventSource: Incorrect code example for filter property #23057

Closed
livzr opened this issue Nov 23, 2022 · 2 comments · Fixed by #23085
Closed

DynamoEventSource: Incorrect code example for filter property #23057

livzr opened this issue Nov 23, 2022 · 2 comments · Fixed by #23085
Labels
@aws-cdk/aws-lambda-event-sources documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@livzr
Copy link
Contributor

livzr commented Nov 23, 2022

Describe the issue

When applying a filter property from the given code example, an error is thrown by CloudFormation.

fn.addEventSource(new eventsources.DynamoEventSource(table, {
  filters: [{ eventName: aws_lambda.FilterRule.isEqual('INSERT') }],
}));

Resource handler returned message: "Invalid request provided: Invalid filter pattern definition.

When using it in this format, it works as expected.

fn.addEventSource(new eventsources.DynamoEventSource(table, {
  filters: [aws_lambda.FilterCriteria.filter({ eventName: aws_lambda.FilterRule.isEqual('INSERT') })],
}));

Links

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_event_sources.DynamoEventSource.html

@livzr livzr added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Nov 23, 2022
@peterwoodworth peterwoodworth added good first issue Related to contributions. See CONTRIBUTING.md p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Nov 24, 2022
@peterwoodworth
Copy link
Contributor

Thanks for letting us know,

This is found in our Lambda readme https://github.com/aws/aws-cdk/blob/v2.51.1/packages/%40aws-cdk/aws-lambda/README.md

If you'd like to fix this for us feel free 🙂

@mergify mergify bot closed this as completed in #23085 Nov 25, 2022
mergify bot pushed a commit that referenced this issue Nov 25, 2022
----

fixes #23057 

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-event-sources documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants