# Filter Pattern is not being applied on Trigger through Serverless.yaml

**URL:** <https://forum.serverless.com/t/filter-pattern-is-not-being-applied-on-trigger-through-serverless-yaml/17321>\
**Category:** Serverless Framework\
**Tags:** lambda, dynamodb\
**Created:** [June 14, 2022, 2:15pm UTC](https://forum.serverless.com/t/filter-pattern-is-not-being-applied-on-trigger-through-serverless-yaml/17321 "2022-06-14T14:15:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yudi005](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@yudi005](https://forum.serverless.com/u/yudi005)\
**Post date:** [June 14, 2022, 2:15pm UTC](https://forum.serverless.com/t/filter-pattern-is-not-being-applied-on-trigger-through-serverless-yaml/17321/1 "2022-06-14T14:15:50Z")

</div>

Hi,

I am currently using lambda, dynamodb + streams in my project.

Scenario :  
I want to trigger the lambda as soon as a record is inserted into the dynamodb.  
The lambda should only be triggered for INSERT event.  
On manually adding the trigger and applying the filter event it works as expected and the lambda is triggered only for INSERT events and is visible in lambda console.

Problem :  
When the Lambda is being deployed through serverless.yaml file only the trigger is being successfully applied on the lambda and also visible in the lambda console.  
The issue is the filter pattern is not being applied on the trigger. Due to which all the events INSERT MODIFY & REMOVE are triggering the lambda.

The serverless file has also been verified through a yaml validator and no issues there.

I’m using dotnet 6 as the runtime.

Partial Serverless File :

```auto
functions: 
  operation-handler: 
      name: com-sit-operation
      description: operation-task
      handler: OperationTask::OperationTask.Operation::OperationFunction 
      timeout: ${self:custom.lambdaTimeout}
      disableLogs: false
      events:
          - stream:
              type: dynamodb
              arn: ${self:custom.tableStreamArn}
              filterPatterns:
                - eventName: [INSERT]
              batchSize: 30
              startingPosition: LATEST
              batchWindow: 300
              enabled: true

```

Any help would be appreciated. Thanks in advance.
