-
Notifications
You must be signed in to change notification settings - Fork 4.5k
aws-lambda: FilterRule.null() returns empty array #31458
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-lambdaRelated to AWS LambdaRelated to AWS LambdabugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp1
Description
Describe the bug
According to the documentation here, the FilterPattern should be [null]. However, the function FilterRule.null() currently returns an empty array [] instead.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
The filter pattern for null should be
{ "eventName": [ "INSERT" ], "dynamodb": { "NewImage": { "test": { "S": [ null ] } } } }
Current Behavior
The filter pattern currently being returned is
{ "eventName": [ "INSERT" ], "dynamodb": { "NewImage": { "test": { "S": [] } } } }
Reproduction Steps
Construct an EventSourceMapping
new lambda.EventSourceMapping(
this,
`${stackPrefix}-lambda-event-source-mapping`,
{
startingPosition: StartingPosition.TRIM_HORIZON,
target:XXXX,
eventSourceArn: XXXX,
reportBatchItemFailures: true,
filters: [
lambda.FilterCriteria.filter({
eventName: lambda.FilterRule.isEqual('INSERT'),
dynamodb: {
NewImage: {
test: { S: lambda.FilterRule.exists() },
},
},
}),
],
}
);
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.155.0
Framework Version
No response
Node.js Version
v20.11.0
OS
Sonoma
Language
TypeScript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-lambdaRelated to AWS LambdaRelated to AWS LambdabugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp1