Search code examples
aws-cloudformationaws-cdk

Encountered unsupported property FilterCriteria during cdk deploy of EventSource filter


Suddenly stopped working if I add filters, without changing anything:

claLambda.addEventSource(new lambdaEventSources.DynamoEventSource(drTable, {
   startingPosition: lambda.StartingPosition.TRIM_HORIZON,
   batchSize: 5,
   retryAttempts: 0,
   bisectBatchOnError: false,
   filters: [
     lambda.FilterCriteria.filter({
       eventName: lambda.FilterRule.isEqual("INSERT"),
       dynamodb: {  NewImage: { description: { S: lambda.FilterRule.exists() } }}
     }),
   ]
}));

Error during deployment when filters parameter is defined:

UPDATE_FAILED        | AWS::Lambda::EventSourceMapping     | cladrLambda/DynamoDBEventSource:drBackendStackdrTable2C197F4B (cladrLambdaDynamoDBEventSourcedrBackendStackdrTable2C197F4BBAD743BC) Encountered unsupported property FilterCriteria

Solution

  • Had the same today, probably a hiccup on Cloudformation side? Because this morning tried again and it worked